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

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

Issue 195793013: Add support for closure calls through getters. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix status file and remove bad type.wq Created 6 years, 8 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: sdk/lib/_internal/lib/js_helper.dart
diff --git a/sdk/lib/_internal/lib/js_helper.dart b/sdk/lib/_internal/lib/js_helper.dart
index 76d615f6fbb893eff708514ede31bea01d1e04a3..97e4a5b99bb408ecf2077c581a2d148ec455627c 100644
--- a/sdk/lib/_internal/lib/js_helper.dart
+++ b/sdk/lib/_internal/lib/js_helper.dart
@@ -150,8 +150,7 @@ class JSInvocationMirror implements Invocation {
List get positionalArguments {
if (isGetter) return const [];
- var argumentCount =
- _arguments.length - _namedArgumentNames.length;
+ var argumentCount = _arguments.length - _namedArgumentNames.length;
if (argumentCount == 0) return const [];
var list = [];
for (var index = 0 ; index < argumentCount ; index++) {
@@ -274,6 +273,7 @@ class CachedInvocation {
this.cachedInterceptor);
bool get isNoSuchMethod => false;
+ bool get isGetterStub => JS("bool", "!!#.\$getterStub", jsFunction);
/// Applies [jsFunction] to [victim] with [arguments].
/// Users of this class must take care to check the arguments first.
@@ -299,6 +299,8 @@ class CachedCatchAllInvocation extends CachedInvocation {
: info = new ReflectionInfo(jsFunction),
super(name, jsFunction, isIntercepted, cachedInterceptor);
+ bool get isGetterStub => false;
+
invokeOn(Object victim, List arguments) {
var receiver = victim;
int providedArgumentCount;
@@ -350,6 +352,7 @@ class CachedNoSuchMethodInvocation {
CachedNoSuchMethodInvocation(this.interceptor);
bool get isNoSuchMethod => true;
+ bool get isGetterStub => false;
invokeOn(Object victim, Invocation invocation) {
var receiver = (interceptor == null) ? victim : interceptor;

Powered by Google App Engine
This is Rietveld 408576698