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

Unified Diff: pkg/compiler/lib/src/cps_ir/cps_ir_nodes_sexpr.dart

Issue 1585503002: dart2js: CPS translation of switches with continue to their labels. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Update test expectations. Created 4 years, 11 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
Index: pkg/compiler/lib/src/cps_ir/cps_ir_nodes_sexpr.dart
diff --git a/pkg/compiler/lib/src/cps_ir/cps_ir_nodes_sexpr.dart b/pkg/compiler/lib/src/cps_ir/cps_ir_nodes_sexpr.dart
index e2c8e603ee986bf9f009ecfecc6661419b3cc132..5250c7985d3673f6332839d9c4c71154c2dd0fb2 100644
--- a/pkg/compiler/lib/src/cps_ir/cps_ir_nodes_sexpr.dart
+++ b/pkg/compiler/lib/src/cps_ir/cps_ir_nodes_sexpr.dart
@@ -30,6 +30,7 @@ class SExpressionStringifier extends Indentation implements Visitor<String> {
}
String access(Reference<Definition> r) {
+ if (r == null) return '**** NULL ****';
return decorator(r, namer.getName(r.definition));
}
@@ -48,7 +49,11 @@ class SExpressionStringifier extends Indentation implements Visitor<String> {
/// Main entry point for creating a [String] from a [Node]. All recursive
/// calls must go through this method.
String visit(Node node) {
- if (node == null) return '**** NULL ****';
+ if (node == null) {
+ return node is Expression
asgerf 2016/01/19 22:45:24 Dead code, null is not an expression.
Kevin Millikin (Google) 2016/01/25 12:46:37 Done.
+ ? '$indentation**** NULL ****'
+ : '**** NULL ****';
+ }
String s = node.accept(this);
return decorator(node, s);
}
@@ -192,7 +197,9 @@ class SExpressionStringifier extends Indentation implements Visitor<String> {
String visitInvokeContinuation(InvokeContinuation node) {
String name = access(node.continuation);
if (node.isRecursive) name = 'rec $name';
- String args = node.arguments.map(access).join(' ');
+ String args = node.arguments == null
+ ? '**** NULL ****'
+ : node.arguments.map(access).join(' ');
String escaping = node.isEscapingTry ? ' escape' : '';
return '$indentation(InvokeContinuation $name ($args)$escaping)';
}

Powered by Google App Engine
This is Rietveld 408576698