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

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: 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 | « no previous file | test/codegen/expect/try_catch.js » ('j') | test/codegen/try_catch.dart » ('J')
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..47c1155a4b7123c10c0ed6032aafa70752e8f1e3 100644
--- a/lib/src/js/nodes.dart
+++ b/lib/src/js/nodes.dart
@@ -275,7 +275,8 @@ class If extends Statement {
final Node then;
final Node otherwise;
- If(this.condition, this.then, this.otherwise);
+ If(this.condition, this.then, Node otherwise) :
Jacob 2015/03/27 17:04:30 We could alternately make this constructor assert
Jennifer Messerly 2015/03/27 17:15:54 Agreed. Another option would be to just have null
+ otherwise = otherwise != null ? otherwise : new EmptyStatement();
If.noElse(this.condition, this.then) : this.otherwise = new EmptyStatement();
bool get hasElse => otherwise is !EmptyStatement;
« no previous file with comments | « no previous file | test/codegen/expect/try_catch.js » ('j') | test/codegen/try_catch.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698