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

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

Issue 1169473003: fixes #43, remove => workaround (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 5 years, 7 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/harmony_feature_check.js ('k') | lib/src/js/printer.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/js/nodes.dart
diff --git a/lib/src/js/nodes.dart b/lib/src/js/nodes.dart
index 34d1618b4d76e1159d12096344ea15e416dea486..2b62fea9c2399c2511a7fb4e4529dd1fb6b2a0e4 100644
--- a/lib/src/js/nodes.dart
+++ b/lib/src/js/nodes.dart
@@ -958,8 +958,6 @@ class ArrowFun extends FunctionExpression {
final List<Identifier> params;
final body; // Expression or Block
- bool _bindThisWorkaround; // lazy initialized
-
ArrowFun(this.params, this.body);
accept(NodeVisitor visitor) => visitor.visitArrowFun(this);
@@ -971,29 +969,10 @@ class ArrowFun extends FunctionExpression {
ArrowFun _clone() => new ArrowFun(params, body);
- /// This is a workaround for V8 arrow function bindings being not yet
- /// implemented. See <https://code.google.com/p/v8/issues/detail?id=2700>
- bool get bindThisWorkaround {
- if (_bindThisWorkaround != null) return _bindThisWorkaround;
- var visitor = new _ThisFinder();
- body.accept(visitor);
- return _bindThisWorkaround = visitor.found;
- }
-
/// Ensure parens always get generated if necessary.
// TODO(jmesserly): I'm not sure the printer is handling this correctly for
// function() { ... } either.
- int get precedenceLevel => bindThisWorkaround ? CALL : ASSIGNMENT;
-}
-
-class _ThisFinder extends BaseVisitor {
- bool found = false;
- visitThis(This node) {
- found = true;
- }
- visitNode(Node node) {
- if (!found) super.visitNode(node);
- }
+ int get precedenceLevel => ASSIGNMENT;
}
class AsyncModifier {
« no previous file with comments | « lib/runtime/harmony_feature_check.js ('k') | lib/src/js/printer.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698