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

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

Issue 1316723003: implement null aware ops, fixes #249 (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 5 years, 4 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_metalet.dart ('k') | test/browser/language_tests.js » ('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 f5d0ed5d7a4145315793c681835f6dc2849357bd..b8ebd3159e3c319e9e705b4b442c36684ae73ec6 100644
--- a/lib/src/js/nodes.dart
+++ b/lib/src/js/nodes.dart
@@ -445,8 +445,26 @@ class Return extends Statement {
}
Return _clone() => new Return(value);
+
+ static bool foundIn(Node node) {
+ _returnFinder.found = false;
+ node.accept(_returnFinder);
+ return _returnFinder.found;
+ }
+}
+
+final _returnFinder = new _ReturnFinder();
+class _ReturnFinder extends BaseVisitor {
+ bool found = false;
+ visitReturn(Return node) {
+ found = true;
+ }
+ visitNode(Node node) {
+ if (!found) super.visitNode(node);
+ }
}
+
class Throw extends Statement {
final Expression expression;
« no previous file with comments | « lib/src/codegen/js_metalet.dart ('k') | test/browser/language_tests.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698