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

Side by Side Diff: pkg/analyzer/lib/src/task/incremental_element_builder.dart

Issue 2136853002: Adding/removing 'abstract' keyword is not a class delta change. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 5 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 unified diff | Download patch
« no previous file with comments | « no previous file | pkg/analyzer/test/src/task/incremental_element_builder_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library analyzer.src.task.incremental_element_builder; 5 library analyzer.src.task.incremental_element_builder;
6 6
7 import 'dart:collection'; 7 import 'dart:collection';
8 8
9 import 'package:analyzer/dart/ast/ast.dart'; 9 import 'package:analyzer/dart/ast/ast.dart';
10 import 'package:analyzer/dart/ast/token.dart'; 10 import 'package:analyzer/dart/ast/token.dart';
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 unitElementHolder.addAccessor(element); 148 unitElementHolder.addAccessor(element);
149 } else if (element is TopLevelVariableElement) { 149 } else if (element is TopLevelVariableElement) {
150 unitElementHolder.addTopLevelVariable(element); 150 unitElementHolder.addTopLevelVariable(element);
151 } 151 }
152 } 152 }
153 153
154 ClassElementDelta _processClassMembers( 154 ClassElementDelta _processClassMembers(
155 ClassDeclaration oldClass, ClassDeclaration newClass) { 155 ClassDeclaration oldClass, ClassDeclaration newClass) {
156 // If the class hierarchy or type parameters are changed, 156 // If the class hierarchy or type parameters are changed,
157 // then the class changed too much - don't compute the delta. 157 // then the class changed too much - don't compute the delta.
158 if (TokenUtils.getFullCode(newClass.typeParameters) != 158 if (newClass.abstractKeyword != null && oldClass.abstractKeyword == null ||
159 newClass.abstractKeyword == null && oldClass.abstractKeyword != null ||
160 TokenUtils.getFullCode(newClass.typeParameters) !=
159 TokenUtils.getFullCode(oldClass.typeParameters) || 161 TokenUtils.getFullCode(oldClass.typeParameters) ||
160 TokenUtils.getFullCode(newClass.extendsClause) != 162 TokenUtils.getFullCode(newClass.extendsClause) !=
161 TokenUtils.getFullCode(oldClass.extendsClause) || 163 TokenUtils.getFullCode(oldClass.extendsClause) ||
162 TokenUtils.getFullCode(newClass.withClause) != 164 TokenUtils.getFullCode(newClass.withClause) !=
163 TokenUtils.getFullCode(oldClass.withClause) || 165 TokenUtils.getFullCode(oldClass.withClause) ||
164 TokenUtils.getFullCode(newClass.implementsClause) != 166 TokenUtils.getFullCode(newClass.implementsClause) !=
165 TokenUtils.getFullCode(oldClass.implementsClause)) { 167 TokenUtils.getFullCode(oldClass.implementsClause)) {
166 return null; 168 return null;
167 } 169 }
168 // Build the old class members map. 170 // Build the old class members map.
(...skipping 526 matching lines...) Expand 10 before | Expand all | Expand 10 after
695 } 697 }
696 } 698 }
697 super.visitElement(element); 699 super.visitElement(element);
698 } 700 }
699 701
700 static bool _isVariableInitializer(Element element) { 702 static bool _isVariableInitializer(Element element) {
701 return element is FunctionElement && 703 return element is FunctionElement &&
702 element.enclosingElement is VariableElement; 704 element.enclosingElement is VariableElement;
703 } 705 }
704 } 706 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analyzer/test/src/task/incremental_element_builder_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698