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

Unified Diff: pkg/analyzer/lib/src/dart/ast/utilities.dart

Issue 1710163002: Always set the previous token in AstCloner. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 10 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 | pkg/analyzer/test/generated/utilities_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/dart/ast/utilities.dart
diff --git a/pkg/analyzer/lib/src/dart/ast/utilities.dart b/pkg/analyzer/lib/src/dart/ast/utilities.dart
index 05ff07f1442b04ef2e3ca3b6c19b8e3e0ee53f42..107a28b1f691721f37965cda94e51ca69c77c802 100644
--- a/pkg/analyzer/lib/src/dart/ast/utilities.dart
+++ b/pkg/analyzer/lib/src/dart/ast/utilities.dart
@@ -42,7 +42,7 @@ class AstCloner implements AstVisitor<AstNode> {
/**
* The last cloned token.
*/
- Token _lastCloned;
+ Token _lastCloned = new Token(TokenType.EOF, -1);
Brian Wilkerson 2016/02/18 21:00:34 The EOF token should be it's own 'previous' token.
/**
* The offset of the last cloned token.
@@ -952,7 +952,7 @@ class AstCloner implements AstVisitor<AstNode> {
}
}
_clonedTokens[token] = clone;
- _lastCloned?.setNext(clone);
+ _lastCloned.setNext(clone);
_lastCloned = clone;
if (token.type == TokenType.EOF) {
break;
« no previous file with comments | « no previous file | pkg/analyzer/test/generated/utilities_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698