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

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

Issue 1677683002: Include default parameter values into summary. (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
« no previous file with comments | « pkg/analyzer/lib/src/summary/idl.dart ('k') | pkg/analyzer/lib/src/summary/summarize_elements.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 e956a52e2aeacb18ac47e6bb5ecb5434c95ec7fc..fbe285782b2ba9e263fefd2d5cacf9f2f87a1a41 100644
--- a/pkg/analyzer/lib/src/summary/summarize_ast.dart
+++ b/pkg/analyzer/lib/src/summary/summarize_ast.dart
@@ -62,9 +62,8 @@ class _ConstExprSerializer extends AbstractConstExprSerializer {
Expression target = access.target;
if (target is Identifier) {
EntityRefBuilder targetRef = serializeIdentifier(target);
- return new EntityRefBuilder(
- reference: visitor.serializeReference(
- targetRef.reference, access.propertyName.name));
+ return new EntityRefBuilder(reference: visitor.serializeReference(
+ targetRef.reference, access.propertyName.name));
} else {
// TODO(scheglov) should we handle other targets in malformed constants?
throw new StateError('Unexpected target type: ${target.runtimeType}');
@@ -696,7 +695,11 @@ class _SummarizeAstVisitor extends SimpleAstVisitor {
@override
UnlinkedParamBuilder visitDefaultFormalParameter(
DefaultFormalParameter node) {
- return node.parameter.accept(this);
+ UnlinkedParamBuilder b = node.parameter.accept(this);
+ if (node.defaultValue != null) {
+ b.defaultValue = serializeConstExpr(node.defaultValue);
+ }
+ return b;
}
@override
« no previous file with comments | « pkg/analyzer/lib/src/summary/idl.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