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

Unified Diff: lib/src/js/printer.dart

Issue 1052693004: move => bind this workaround to js_ast (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 5 years, 9 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/src/js/nodes.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/js/printer.dart
diff --git a/lib/src/js/printer.dart b/lib/src/js/printer.dart
index 0b76cc62052d9cc8c15e677c987e20238378236f..7491fae1485fb16abdc3d3bba1c7efb5e9dc9935 100644
--- a/lib/src/js/printer.dart
+++ b/lib/src/js/printer.dart
@@ -824,6 +824,9 @@ class Printer implements NodeVisitor {
}
visitArrowFun(ArrowFun fun) {
+ if (fun.bindThisWorkaround) {
+ out("(");
+ }
localNamer.enterScope(fun);
out("(");
if (fun.params != null) {
@@ -840,6 +843,9 @@ class Printer implements NodeVisitor {
blockBody(fun.body, needsSeparation: false, needsNewline: false);
}
localNamer.leaveScope();
+ if (fun.bindThisWorkaround) {
+ out(").bind(this)");
+ }
}
visitLiteralBool(LiteralBool node) {
« no previous file with comments | « lib/src/js/nodes.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698