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

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

Issue 1768613002: Update codeOffset/codeLength during incremental resolution. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Extract comparing values. 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/lib/src/generated/incremental_resolver.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_resolution_validator.dart
diff --git a/pkg/analyzer/lib/src/generated/incremental_resolution_validator.dart b/pkg/analyzer/lib/src/generated/incremental_resolution_validator.dart
index cf2c0dda5cd198ab6f1412d4eaf4b236f221d02f..78b03551be628cc926dd5635fe5906bcbbcf5a1e 100644
--- a/pkg/analyzer/lib/src/generated/incremental_resolution_validator.dart
+++ b/pkg/analyzer/lib/src/generated/incremental_resolution_validator.dart
@@ -36,7 +36,7 @@ class IncrementalResolutionMismatch {
class _SameResolutionValidator implements AstVisitor {
final bool validateTypes;
- /// The expected node to compare with the visted node.
+ /// The expected node to compare with the visited node.
AstNode other;
_SameResolutionValidator(this.validateTypes, this.other);
@@ -848,13 +848,19 @@ class _SameResolutionValidator implements AstVisitor {
if (a == null && b == null) {
return;
}
- if (a.nameOffset != b.nameOffset) {
- _fail('Expected: ${b.nameOffset}\n Actual: ${a.nameOffset}');
+ _verifyEqual('nameOffset', a.nameOffset, b.nameOffset);
+ if (a is ElementImpl && b is ElementImpl) {
+ _verifyEqual('codeOffset', a.codeOffset, b.codeOffset);
+ _verifyEqual('codeLength', a.codeLength, b.codeLength);
}
if (a is LocalElement && b is LocalElement) {
- if (a.visibleRange != b.visibleRange) {
- _fail('Expected: ${b.visibleRange}\nActual: ${a.visibleRange}');
- }
+ _verifyEqual('visibleRange', a.visibleRange, b.visibleRange);
+ }
+ }
+
+ void _verifyEqual(String name, actual, expected) {
+ if (actual != expected) {
+ _fail('$name\nExpected: $expected\n Actual: $actual');
}
}
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/generated/incremental_resolver.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698