Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(235)

Unified Diff: dart/sdk/lib/_internal/compiler/implementation/lib/js_helper.dart

Issue 14646031: Implement invoke, setField, and getField (unminified). (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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);
+ }
}
/// This method is called by [InstanceMirror.delegate].

Powered by Google App Engine
This is Rietveld 408576698