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

Unified Diff: pkg/analyzer/lib/src/generated/incremental_resolver.dart

Issue 1078953002: Issue 23155. Don't perform incremental resolution if a constructor initializer is changed. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 8 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/incremental_resolver_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/generated/incremental_resolver.dart
diff --git a/pkg/analyzer/lib/src/generated/incremental_resolver.dart b/pkg/analyzer/lib/src/generated/incremental_resolver.dart
index 4b4450021ae4b99376f8caebe227eeabfbd00ff9..1e9b61ddca6fc268e6f9593b7cf677c0f99518a3 100644
--- a/pkg/analyzer/lib/src/generated/incremental_resolver.dart
+++ b/pkg/analyzer/lib/src/generated/incremental_resolver.dart
@@ -1243,9 +1243,9 @@ class PoorMansIncrementalResolver {
}
// Find nodes covering the "old" and "new" token ranges.
AstNode oldNode =
- _findNodeCovering(_oldUnit, beginOffsetOld, endOffsetOld);
+ _findNodeCovering(_oldUnit, beginOffsetOld, endOffsetOld - 1);
AstNode newNode =
- _findNodeCovering(newUnit, beginOffsetNew, endOffsetNew);
+ _findNodeCovering(newUnit, beginOffsetNew, endOffsetNew - 1);
logger.log(() => 'oldNode: $oldNode');
logger.log(() => 'newNode: $newNode');
// Try to find the smallest common node, a FunctionBody currently.
@@ -1257,6 +1257,12 @@ class PoorMansIncrementalResolver {
for (int i = 0; i < length; i++) {
AstNode oldParent = oldParents[i];
AstNode newParent = newParents[i];
+ if (oldParent is ConstructorInitializer ||
+ newParent is ConstructorInitializer) {
+ logger.log('Failure: changes in constant constructor initializers'
+ ' may cause external changes in constant objects.');
+ return false;
+ }
if (oldParent is FunctionDeclaration &&
newParent is FunctionDeclaration ||
oldParent is MethodDeclaration &&
« no previous file with comments | « no previous file | pkg/analyzer/test/generated/incremental_resolver_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698