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

Unified Diff: pkg/kernel/lib/analyzer/loader.dart

Issue 2610133002: Non-format-changing kernel offset changes (Closed)
Patch Set: End offset doesn't appear to be needed on AwaitExpression (anymore) Created 3 years, 11 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
Index: pkg/kernel/lib/analyzer/loader.dart
diff --git a/pkg/kernel/lib/analyzer/loader.dart b/pkg/kernel/lib/analyzer/loader.dart
index 43a1b3dd41f31055c6a0e81bafb19d4ae56108b9..4acb751982ef55e886ccf2ff2028b90f08210f21 100644
--- a/pkg/kernel/lib/analyzer/loader.dart
+++ b/pkg/kernel/lib/analyzer/loader.dart
@@ -268,7 +268,7 @@ class DartLoader implements ReferenceLevelLoader {
_classes[element] = classNode = new ast.Class(
name: element.name,
isAbstract: element.isAbstract,
- fileUri: '${element.source.uri}');
+ fileUri: '${element.source.uri}')..fileOffset = element.nameOffset;
classNode.level = ast.ClassLevel.Temporary;
var library = getLibraryReference(element.library);
library.addClass(classNode);
@@ -317,7 +317,8 @@ class DartLoader implements ReferenceLevelLoader {
areDistinctUnboundTypeVariables(supertype, mixinType)) {
// Use a shared mixin application class for this library.
var mixinClass = getSharedMixinApplicationClass(
- scope.currentLibrary, supertype.classNode, mixinType.classNode);
+ scope.currentLibrary, supertype.classNode, mixinType.classNode)
+ ..fileOffset = element.nameOffset;
asgerf 2017/01/04 14:20:01 What is the class offset used for? Is it okay tha
jensj 2017/01/05 09:07:55 In general class offsets is used by Observatory to
asgerf 2017/01/05 11:37:41 Thanks for the clarification. Looks good to me the
supertype = new ast.Supertype(
mixinClass,
supertype.typeArguments.length > mixinType.typeArguments.length
@@ -333,7 +334,7 @@ class DartLoader implements ReferenceLevelLoader {
typeParameters: freshParameters.freshTypeParameters,
supertype: freshParameters.substituteSuper(supertype),
mixedInType: freshParameters.substituteSuper(mixinType),
- fileUri: classNode.fileUri);
+ fileUri: classNode.fileUri)..fileOffset = element.nameOffset;
mixinClass.level = ast.ClassLevel.Type;
supertype = new ast.Supertype(mixinClass,
classNode.typeParameters.map(makeTypeParameterType).toList());
@@ -446,12 +447,14 @@ class DartLoader implements ReferenceLevelLoader {
isStatic: true,
isExternal: constructor.isExternal,
isConst: constructor.isConst,
- fileUri: '${element.source.uri}');
+ fileUri: '${element.source.uri}')
+ ..fileOffset = element.nameOffset;
}
return new ast.Constructor(scope.buildFunctionInterface(constructor),
name: _nameOfMember(element),
isConst: constructor.isConst,
- isExternal: constructor.isExternal);
+ isExternal: constructor.isExternal)
+ ..fileOffset = element.nameOffset;
case ElementKind.FIELD:
case ElementKind.TOP_LEVEL_VARIABLE:
@@ -480,7 +483,7 @@ class DartLoader implements ReferenceLevelLoader {
isAbstract: executable.isAbstract,
isStatic: executable.isStatic,
isExternal: executable.isExternal,
- fileUri: '${element.source.uri}');
+ fileUri: '${element.source.uri}')..fileOffset = element.nameOffset;
default:
throw 'Unexpected member kind: $element';

Powered by Google App Engine
This is Rietveld 408576698