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

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: 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..3c606d6130aa25f32795a6a07c4448153b6be910 100644
--- a/pkg/compiler/lib/src/js_emitter/program_builder.dart
+++ b/pkg/compiler/lib/src/js_emitter/program_builder.dart
@@ -353,6 +353,14 @@ 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;
floitsch 2015/02/13 12:38:28 New line before.
zarah 2015/02/13 12:52:18 Done.
// 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