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

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: Forgot to save. 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
« no previous file with comments | « no previous file | pkg/compiler/lib/src/js_emitter/model.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..b971f3d40505583bd1189f5c392838f364f14869 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(String name, Selector selector) {
// Values match JSInvocationMirror in js-helper library.
int type = selector.invocationMirrorKind;
List<String> parameterNames =
@@ -177,11 +177,13 @@ 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]);
}
+ return new StubMethod(name, function);
}
}
« no previous file with comments | « no previous file | pkg/compiler/lib/src/js_emitter/model.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698