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

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

Issue 1266483003: format with dart_style 0.2.0-rc.3 (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 5 years, 5 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/codegen/js_codegen.dart ('k') | lib/src/codegen/js_module_item_order.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/codegen/js_metalet.dart
diff --git a/lib/src/codegen/js_metalet.dart b/lib/src/codegen/js_metalet.dart
index 12f7811c390da883ffce5366c1a9c70b887fe550..ae239ed1de8831b1b5adb542218e0b1528a24152 100644
--- a/lib/src/codegen/js_metalet.dart
+++ b/lib/src/codegen/js_metalet.dart
@@ -257,6 +257,7 @@ class _IdentFinder extends BaseVisitor {
@override visitIdentifier(Identifier node) {
if (node.name == name) found = true;
}
+
@override visitNode(Node node) {
if (!found) super.visitNode(node);
}
@@ -269,15 +270,18 @@ class _YieldFinder extends BaseVisitor {
@override visitThis(This node) {
hasThis = true;
}
+
@override visitFunctionExpression(FunctionExpression node) {
var savedNested = _nestedFunction;
_nestedFunction = true;
super.visitFunctionExpression(node);
_nestedFunction = savedNested;
}
+
@override visitYield(Yield node) {
if (!_nestedFunction) hasYield = true;
}
+
@override visitNode(Node node) {
if (!hasYield) super.visitNode(node);
}
« no previous file with comments | « lib/src/codegen/js_codegen.dart ('k') | lib/src/codegen/js_module_item_order.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698