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

Unified Diff: dart/lib/compiler/implementation/tree/unparser.dart

Issue 11117022: Fix a crash related to obsolete factory syntax. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 2 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: dart/lib/compiler/implementation/tree/unparser.dart
diff --git a/dart/lib/compiler/implementation/tree/unparser.dart b/dart/lib/compiler/implementation/tree/unparser.dart
index 8eda6371f0e8af805c210d71917a21d30d29440d..da5868d13441f417b43deb7c4c1354504f49bf01 100644
--- a/dart/lib/compiler/implementation/tree/unparser.dart
+++ b/dart/lib/compiler/implementation/tree/unparser.dart
@@ -271,9 +271,11 @@ class Unparser implements Visitor {
if (spacesNeeded) sb.add(' ');
// Also add a space for sequences like x + +1 and y - -y.
if (opString === '-' || opString === '+') {
- Token beginToken = node.argumentsNode.getBeginToken();
- if (beginToken !== null && beginToken.stringValue === opString) {
- sb.add(' ');
+ if (node.argumentsNode != null) {
karlklose 2012/10/15 07:59:26 You could add this condition to the if above.
Lasse Reichstein Nielsen 2012/10/15 08:34:37 And eventually remove the '+' case when we drop su
+ Token beginToken = node.argumentsNode.getBeginToken();
+ if (beginToken !== null && beginToken.stringValue === opString) {
+ sb.add(' ');
+ }
}
}
visit(node.argumentsNode);

Powered by Google App Engine
This is Rietveld 408576698