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

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

Issue 1686653003: Issue dev_compiler@443. Clone beginToken. (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 33bc8213b9809dc10a2a4335f047ed09ae7ebe58..7390704c7df98df03d7239860e6e5fdae92ee278 100644
--- a/pkg/analyzer/lib/src/dart/ast/utilities.dart
+++ b/pkg/analyzer/lib/src/dart/ast/utilities.dart
@@ -216,17 +216,17 @@ class AstCloner implements AstVisitor<AstNode> {
ClassTypeAlias visitClassTypeAlias(ClassTypeAlias node) {
cloneToken(node.abstractKeyword);
return new ClassTypeAlias(
- cloneNode(node.documentationComment),
- cloneNodeList(node.metadata),
- cloneToken(node.typedefKeyword),
- cloneNode(node.name),
- cloneNode(node.typeParameters),
- cloneToken(node.equals),
- cloneToken(node.abstractKeyword),
- cloneNode(node.superclass),
- cloneNode(node.withClause),
- cloneNode(node.implementsClause),
- cloneToken(node.semicolon));
+ cloneNode(node.documentationComment),
+ cloneNodeList(node.metadata),
+ cloneToken(node.typedefKeyword),
+ cloneNode(node.name),
+ cloneNode(node.typeParameters),
+ cloneToken(node.equals),
+ cloneToken(node.abstractKeyword),
+ cloneNode(node.superclass),
+ cloneNode(node.withClause),
+ cloneNode(node.implementsClause),
+ cloneToken(node.semicolon));
}
@override
@@ -247,16 +247,12 @@ class AstCloner implements AstVisitor<AstNode> {
@override
CompilationUnit visitCompilationUnit(CompilationUnit node) {
- ScriptTag scriptTag = cloneNode(node.scriptTag);
- List<Directive> directives = cloneNodeList(node.directives);
- List<CompilationUnitMember> declarations = cloneNodeList(node.declarations);
- Token endToken = cloneToken(node.endToken);
- Token beginToken = scriptTag?.beginToken ??
- (directives.isEmpty ? null : directives.first.beginToken) ??
- (declarations.isEmpty ? null : declarations.first.beginToken) ??
- endToken;
CompilationUnit clone = new CompilationUnit(
- beginToken, scriptTag, directives, declarations, endToken);
+ cloneToken(node.beginToken),
+ cloneNode(node.scriptTag),
+ cloneNodeList(node.directives),
+ cloneNodeList(node.declarations),
+ cloneToken(node.endToken));
clone.lineInfo = node.lineInfo;
return clone;
}
« 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