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

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

Issue 1686713002: Add support for redirectedConstructor to summaries. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: 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
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 e5f4c4f466ec13db671708770ba7877e11b8b1a9..e43e2e1058ec8ba344111bb9735b509c4a75b7a3 100644
--- a/pkg/analyzer/lib/src/summary/summarize_ast.dart
+++ b/pkg/analyzer/lib/src/summary/summarize_ast.dart
@@ -785,7 +785,22 @@ class _SummarizeAstVisitor extends SimpleAstVisitor {
.map((FormalParameter p) => p.accept(this))
.toList();
b.kind = UnlinkedExecutableKind.constructor;
- b.isFactory = node.factoryKeyword != null;
+ if (node.factoryKeyword != null) {
+ b.isFactory = true;
+ if (node.redirectedConstructor != null) {
+ b.isRedirectedConstructor = true;
+ b.redirectedConstructor = new _ConstExprSerializer(this, null)
+ .serializeConstructorName(node.redirectedConstructor.type,
+ node.redirectedConstructor.name);
+ }
+ } else {
+ for (ConstructorInitializer initializer in node.initializers) {
+ if (initializer is RedirectingConstructorInvocation) {
+ b.isRedirectedConstructor = true;
+ b.redirectedConstructorName = initializer.constructorName?.name;
+ }
+ }
+ }
b.isConst = node.constKeyword != null;
b.isExternal = node.externalKeyword != null;
b.documentationComment = serializeDocumentation(node.documentationComment);
« no previous file with comments | « pkg/analyzer/lib/src/summary/resynthesize.dart ('k') | pkg/analyzer/lib/src/summary/summarize_elements.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698