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

Unified Diff: pkg/analyzer/lib/src/summary/summarize_elements.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/summarize_ast.dart ('k') | pkg/analyzer/test/src/summary/summary_common.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_elements.dart
diff --git a/pkg/analyzer/lib/src/summary/summarize_elements.dart b/pkg/analyzer/lib/src/summary/summarize_elements.dart
index 8e041391e277cbf9bec0dd72b1991872095164f2..7b949c07b4bfe1f3894de67d9aeee2cb2d2cc3be 100644
--- a/pkg/analyzer/lib/src/summary/summarize_elements.dart
+++ b/pkg/analyzer/lib/src/summary/summarize_elements.dart
@@ -608,6 +608,13 @@ class _CompilationUnitSerializer {
b.type = serializeTypeRef(type, context);
}
}
+ if (parameter is ConstVariableElement) {
+ ConstVariableElement constParameter = parameter as ConstVariableElement;
+ Expression initializer = constParameter.constantInitializer;
+ if (initializer != null) {
+ b.defaultValue = serializeConstExpr(initializer);
+ }
+ }
return b;
}
« no previous file with comments | « pkg/analyzer/lib/src/summary/summarize_ast.dart ('k') | pkg/analyzer/test/src/summary/summary_common.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698