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

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

Issue 923463002: dart2js: add special getter to Closure class in new emitter. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Addressed comment. Created 5 years, 10 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 | « pkg/compiler/lib/src/js_emitter/old_emitter/class_emitter.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/js_emitter/program_builder.dart
diff --git a/pkg/compiler/lib/src/js_emitter/program_builder.dart b/pkg/compiler/lib/src/js_emitter/program_builder.dart
index 7036bb73a526943aa7b76c7b6428ec600e21bedc..e5b40e47677c1287e55b28bbbaa5902f51ae73e3 100644
--- a/pkg/compiler/lib/src/js_emitter/program_builder.dart
+++ b/pkg/compiler/lib/src/js_emitter/program_builder.dart
@@ -353,6 +353,15 @@ class ProgramBuilder {
});
}
+ if (element == backend.closureClass) {
+ // We add a special getter here to allow for tearing off a closure from
+ // itself.
+ String name = namer.getterNameFromAccessorName(
+ namer.getMappedInstanceName(Compiler.CALL_OPERATOR_NAME));
+ js.Fun function = js.js('function() { return this; }');
+ callStubs.add(_buildStubMethod(name, function));
+ }
+
ClassElement implementation = element.implementation;
// MixinApplications run through the members of their mixin. Here, we are
« no previous file with comments | « pkg/compiler/lib/src/js_emitter/old_emitter/class_emitter.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698