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

Unified Diff: pkg/compiler/lib/src/js_emitter/class_stub_generator.dart

Issue 896763003: dart2js: emit noSuchMethod stubs in the new emitter. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 11 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: pkg/compiler/lib/src/js_emitter/class_stub_generator.dart
diff --git a/pkg/compiler/lib/src/js_emitter/class_stub_generator.dart b/pkg/compiler/lib/src/js_emitter/class_stub_generator.dart
index 366ede2e704e2271e54b6943d4f95c70e6ed3926..b6deb582a90b00ee3ed1d9e70c1b1d1c31547e7f 100644
--- a/pkg/compiler/lib/src/js_emitter/class_stub_generator.dart
+++ b/pkg/compiler/lib/src/js_emitter/class_stub_generator.dart
@@ -143,7 +143,7 @@ class ClassStubGenerator {
return jsNames;
}
- jsAst.Expression generateStubForNoSuchMethod(Selector selector) {
+ StubMethod generateStubForNoSuchMethod(Selector selector) {
// Values match JSInvocationMirror in js-helper library.
int type = selector.invocationMirrorKind;
List<String> parameterNames =
@@ -177,11 +177,14 @@ class ClassStubGenerator {
new jsAst.ArrayInitializer(parameterNames.map(js).toList()),
'namedArguments': new jsAst.ArrayInitializer(argNames)});
+ jsAst.Expression function;
if (backend.isInterceptedName(selector.name)) {
- return js(r'function($receiver, #) { return # }',
- [parameterNames, expression]);
+ function = js(r'function($receiver, #) { return # }',
+ [parameterNames, expression]);
} else {
- return js(r'function(#) { return # }', [parameterNames, expression]);
+ function = js(r'function(#) { return # }', [parameterNames, expression]);
}
+ String name = namer.invocationName(selector);
+ return new StubMethod(name, function);
}
}

Powered by Google App Engine
This is Rietveld 408576698