Chromium Code Reviews| Index: dart/sdk/lib/_internal/compiler/implementation/lib/js_helper.dart |
| diff --git a/dart/sdk/lib/_internal/compiler/implementation/lib/js_helper.dart b/dart/sdk/lib/_internal/compiler/implementation/lib/js_helper.dart |
| index 290385f39c36313e745f62de91c45ccabb0328f4..8661351493ba881c7d1eda3bf7ae7e68a0426ff9 100644 |
| --- a/dart/sdk/lib/_internal/compiler/implementation/lib/js_helper.dart |
| +++ b/dart/sdk/lib/_internal/compiler/implementation/lib/js_helper.dart |
| @@ -133,7 +133,12 @@ class JSInvocationMirror implements Invocation { |
| arguments = [object]..addAll(arguments); |
| receiver = interceptor; |
| } |
| - return JS("var", "#[#].apply(#, #)", receiver, name, receiver, arguments); |
| + var method = JS('var', '#[#]', receiver, name); |
| + if (JS('String', 'typeof #', method) == 'function') { |
| + return JS("var", "#.apply(#, #)", method, receiver, arguments); |
| + } else { |
| + return receiver.noSuchMethod(this); |
|
ngeoffray
2013/05/08 12:34:06
Please add a comment why you have to explicitly ca
ahe
2013/05/08 21:47:53
Sorry, I thought it was obvious.
If receiver does
|
| + } |
| } |
| /// This method is called by [InstanceMirror.delegate]. |