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

Unified Diff: lib/src/codegen/js_codegen.dart

Issue 1310513013: fixes #314, super method tear offs (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 5 years, 3 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 | « lib/runtime/_classes.js ('k') | test/browser/language_tests.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/codegen/js_codegen.dart
diff --git a/lib/src/codegen/js_codegen.dart b/lib/src/codegen/js_codegen.dart
index 3b421f4e912f79c3d799512b4a9f32ca311efe4d..048bb5c8508f6633a0b5a295e4f98eedc4740c58 100644
--- a/lib/src/codegen/js_codegen.dart
+++ b/lib/src/codegen/js_codegen.dart
@@ -2644,7 +2644,9 @@ class JSCodegenVisitor extends GeneralizingAstVisitor with ClosureAnnotator {
String code;
if (member != null && member is MethodElement && !isStatic) {
// Tear-off methods: explicitly bind it.
- if (_requiresStaticDispatch(target, memberId.name)) {
+ if (target is SuperExpression) {
+ return js.call('dart.bind(this, #, #.#)', [name, _visit(target), name]);
+ } else if (_requiresStaticDispatch(target, memberId.name)) {
var type = member.type;
var clos = js.call('dart.#.bind(#)', [name, _visit(target)]);
return js.call('dart.fn(#, #)', [clos, _emitFunctionTypeParts(type)]);
« no previous file with comments | « lib/runtime/_classes.js ('k') | test/browser/language_tests.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698