Chromium Code Reviews| Index: dart/sdk/lib/_internal/compiler/js_lib/js_mirrors.dart |
| diff --git a/dart/sdk/lib/_internal/compiler/js_lib/js_mirrors.dart b/dart/sdk/lib/_internal/compiler/js_lib/js_mirrors.dart |
| index e34319e58c2b6d8aee4ed75c3b8490822bad867e..8df98a64291939a671a7c34d8c544343cf59f74e 100644 |
| --- a/dart/sdk/lib/_internal/compiler/js_lib/js_mirrors.dart |
| +++ b/dart/sdk/lib/_internal/compiler/js_lib/js_mirrors.dart |
| @@ -2236,14 +2236,16 @@ class JsClosureMirror extends JsInstanceMirror implements ClosureMirror { |
| String callPrefix = "${JS_GET_NAME(JsGetName.CALL_PREFIX)}\$"; |
| var extractCallName = JS('', r''' |
| function(reflectee) { |
| - for (var property in reflectee) { |
| - if (# == property.substring(0, #) && |
| - property[#] >= '0' && |
| - property[#] <= '9') return property; |
| + var properties = Object.keys(reflectee); |
|
ahe
2015/02/20 14:32:16
I'm pretty sure I was too lazy to use hasOwnProper
floitsch
2015/02/20 16:08:03
Change LGTM. The call-properties are stored on the
ahe
2015/02/20 18:05:19
Turns out that the property is stored on the proto
|
| + for (var i = 0; i < properties.length; i++) { |
| + var property = properties[i]; |
| + if (#callPrefix == property.substring(0, #callPrefix_length) && |
| + property[#callPrefix_length] >= '0' && |
| + property[#callPrefix_length] <= '9') return property; |
| } |
| return null; |
| } |
| -''', callPrefix, callPrefix.length, callPrefix.length, callPrefix.length); |
| +''', { 'callPrefix': callPrefix, 'callPrefix_length': callPrefix.length }); |
| String callName = JS('String|Null', '#(#)', extractCallName, reflectee); |
| if (callName == null) { |
| throw new RuntimeError('Cannot find callName on "$reflectee"'); |