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

Unified Diff: pkg/analyzer/lib/src/summary/summarize_ast.dart

Issue 1839633002: Fix for 'hasNoSupertype' for Object when summarize AST. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 9 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/src/summary/summarize_ast_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/summary/summarize_ast.dart
diff --git a/pkg/analyzer/lib/src/summary/summarize_ast.dart b/pkg/analyzer/lib/src/summary/summarize_ast.dart
index 385c4c195195474d991161bab264850edf478968..9a4e054db6e26f20b913d6e81c4f1ad4fc881b4e 100644
--- a/pkg/analyzer/lib/src/summary/summarize_ast.dart
+++ b/pkg/analyzer/lib/src/summary/summarize_ast.dart
@@ -255,6 +255,11 @@ class _SummarizeAstVisitor extends RecursiveAstVisitor {
final Map<int, Map<String, int>> nameToReference = <int, Map<String, int>>{};
/**
+ * True if the 'dart:core' library is been summarizing.
Paul Berry 2016/03/28 15:38:33 s/is been summarizing/is being summarized/
+ */
+ bool isCoreLibrary = false;
+
+ /**
* If the library has a library directive, the library name derived from it.
* Otherwise `null`.
*/
@@ -375,6 +380,8 @@ class _SummarizeAstVisitor extends RecursiveAstVisitor {
serializeTypeParameters(typeParameters, typeParameterScope);
if (superclass != null) {
b.supertype = serializeTypeName(superclass);
+ } else {
+ b.hasNoSupertype = isCoreLibrary && name == 'Object';
}
if (withClause != null) {
b.mixins = withClause.mixinTypes.map(serializeTypeName).toList();
@@ -1076,6 +1083,7 @@ class _SummarizeAstVisitor extends RecursiveAstVisitor {
node.name.components.map((SimpleIdentifier id) => id.name).join('.');
libraryNameOffset = node.name.offset;
libraryNameLength = node.name.length;
+ isCoreLibrary = libraryName == 'dart.core';
libraryDocumentationComment =
serializeDocumentation(node.documentationComment);
libraryAnnotations = serializeAnnotations(node.metadata);
@@ -1109,7 +1117,9 @@ class _SummarizeAstVisitor extends RecursiveAstVisitor {
}
@override
- void visitPartOfDirective(PartOfDirective node) {}
+ void visitPartOfDirective(PartOfDirective node) {
+ isCoreLibrary = node.libraryName.name == 'dart.core';
+ }
@override
UnlinkedParamBuilder visitSimpleFormalParameter(SimpleFormalParameter node) {
« no previous file with comments | « no previous file | pkg/analyzer/test/src/summary/summarize_ast_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698