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

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

Issue 1963213002: Remove 'name' from argumentNames and replace with 'argumentsNames' in UnlinkedConstructorInitialize… (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 7 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_const_expr.dart
diff --git a/pkg/analyzer/lib/src/summary/summarize_const_expr.dart b/pkg/analyzer/lib/src/summary/summarize_const_expr.dart
index e65e33a71c93dcbc250a8568466bcd79fa78e960..59576a673d00085a992cdafecb077c5fd11ca8ab 100644
--- a/pkg/analyzer/lib/src/summary/summarize_const_expr.dart
+++ b/pkg/analyzer/lib/src/summary/summarize_const_expr.dart
@@ -22,19 +22,35 @@ UnlinkedConstructorInitializer serializeConstructorInitializer(
name: node.fieldName.name,
expression: serializeConstExpr(node.expression));
}
+
+ List<UnlinkedConstBuilder> arguments = <UnlinkedConstBuilder>[];
+ List<String> argumentNames = <String>[];
+ void serializeArguments(List<Expression> args) {
+ for (Expression arg in args) {
+ if (arg is NamedExpression) {
+ NamedExpression namedExpression = arg;
+ argumentNames.add(namedExpression.name.label.name);
+ arg = namedExpression.expression;
+ }
+ arguments.add(serializeConstExpr(arg));
+ }
+ }
+
if (node is RedirectingConstructorInvocation) {
+ serializeArguments(node.argumentList.arguments);
return new UnlinkedConstructorInitializerBuilder(
kind: UnlinkedConstructorInitializerKind.thisInvocation,
name: node?.constructorName?.name,
- arguments:
- node.argumentList.arguments.map(serializeConstExpr).toList());
+ arguments: arguments,
+ argumentNames: argumentNames);
}
if (node is SuperConstructorInvocation) {
+ serializeArguments(node.argumentList.arguments);
return new UnlinkedConstructorInitializerBuilder(
kind: UnlinkedConstructorInitializerKind.superInvocation,
name: node?.constructorName?.name,
- arguments:
- node.argumentList.arguments.map(serializeConstExpr).toList());
+ arguments: arguments,
+ argumentNames: argumentNames);
}
throw new StateError('Unexpected initializer type ${node.runtimeType}');
}
@@ -162,7 +178,6 @@ abstract class AbstractConstExprSerializer {
UnlinkedConstBuilder toBuilder() {
return new UnlinkedConstBuilder(
isValidConst: isValidConst,
- name: name,
operations: operations,
assignmentOperators: assignmentOperators,
ints: ints,
« no previous file with comments | « pkg/analyzer/lib/src/summary/resynthesize.dart ('k') | pkg/analyzer/test/src/summary/resynthesize_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698