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

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

Issue 1952663006: Support for NamedExpression(s) as constructor initializer arguments. (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/resynthesize.dart
diff --git a/pkg/analyzer/lib/src/summary/resynthesize.dart b/pkg/analyzer/lib/src/summary/resynthesize.dart
index 15b712d6eb7ecd5cd47051c360eece0de799eb98..324d83dee4d8f8b4c07a993789f17a0fbfb1345c 100644
--- a/pkg/analyzer/lib/src/summary/resynthesize.dart
+++ b/pkg/analyzer/lib/src/summary/resynthesize.dart
@@ -283,9 +283,15 @@ class _ConstExprBuilder {
_ConstExprBuilder(this.resynthesizer, this.uc);
- Expression get expr => stack.single;
-
Expression build() {
+ Expression expr = _build();
+ if (uc.name.isNotEmpty) {
+ return AstFactory.namedExpression2(uc.name, expr);
+ }
+ return expr;
+ }
+
+ Expression _build() {
if (!uc.isValidConst) {
return AstFactory.identifier3(r'$$invalidConstExpr$$');
}

Powered by Google App Engine
This is Rietveld 408576698