Chromium Code Reviews| Index: sdk/lib/_internal/lib/js_mirrors.dart |
| diff --git a/sdk/lib/_internal/lib/js_mirrors.dart b/sdk/lib/_internal/lib/js_mirrors.dart |
| index 6b58b6f457502afa755a0e95e3e08ac02c5545f3..5228baae5b4458685d6f874a641b129d3d9f0aa1 100644 |
| --- a/sdk/lib/_internal/lib/js_mirrors.dart |
| +++ b/sdk/lib/_internal/lib/js_mirrors.dart |
| @@ -878,10 +878,11 @@ class JsInstanceMirror extends JsObjectMirror implements InstanceMirror { |
| /// reflective information to know how to to invoke a specific member. |
| get _classInvocationCache { |
| String cacheName = Primitives.mirrorInvokeCacheName; |
| - var cache = JS('', r'#.constructor[#]', reflectee, cacheName); |
| + var cacheHolder = reflectee == null ? getInterceptor(null) : reflectee; |
|
kasperl
2014/02/13 07:07:08
() around the comparison?
floitsch
2014/02/13 10:26:30
Done.
|
| + var cache = JS('', r'#.constructor[#]', cacheHolder, cacheName); |
| if (cache == null) { |
| cache = JsCache.allocate(); |
| - JS('void', r'#.constructor[#] = #', reflectee, cacheName, cache); |
| + JS('void', r'#.constructor[#] = #', cacheHolder, cacheName, cache); |
| } |
| return cache; |
| } |
| @@ -1070,7 +1071,7 @@ class JsInstanceMirror extends JsObjectMirror implements InstanceMirror { |
| // interceptor between multiple different instances of [InstanceMirror]. |
| var interceptor = getInterceptor(object); |
| if (!useEval) return _newInterceptGetterNoEvalFn(name, interceptor); |
| - String className = JS('String', '#.constructor.name', object); |
| + String className = JS('String', '#.constructor.name', interceptor); |
| var body = "(function $className\$$name(o){return i.$name(o)})"; |
| return JS('', '(function(b,i){return eval(b)})(#,#)', body, interceptor); |
| } |