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

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

Issue 1036333003: Fix try catch crasher bug due to null else case. (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: ptal 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/codegen/js_codegen.dart ('k') | test/codegen/expect/try_catch.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 9e2553fb9215fcaf3604764828d77e0458b70859..ba4f4faf51dec83ebf0608638874096003a971c4 100644
--- a/lib/src/js/nodes.dart
+++ b/lib/src/js/nodes.dart
@@ -276,16 +276,16 @@ class If extends Statement {
final Node otherwise;
If(this.condition, this.then, this.otherwise);
- If.noElse(this.condition, this.then) : this.otherwise = new EmptyStatement();
+ If.noElse(this.condition, this.then) : this.otherwise = null;
- bool get hasElse => otherwise is !EmptyStatement;
+ bool get hasElse => otherwise != null;
accept(NodeVisitor visitor) => visitor.visitIf(this);
void visitChildren(NodeVisitor visitor) {
condition.accept(visitor);
then.accept(visitor);
- otherwise.accept(visitor);
+ if (otherwise != null) otherwise.accept(visitor);
}
If _clone() => new If(condition, then, otherwise);
« no previous file with comments | « lib/src/codegen/js_codegen.dart ('k') | test/codegen/expect/try_catch.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698