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

Unified Diff: runtime/vm/parser.cc

Issue 12036005: Allow cascades in initializer lists. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Remove inadvertently pasted comment. Created 7 years, 11 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: runtime/vm/parser.cc
diff --git a/runtime/vm/parser.cc b/runtime/vm/parser.cc
index 40772748a257a9df3dd040e3685d594526b1c084..31af5a882fd2854cc766d017a78e36946889d64c 100644
--- a/runtime/vm/parser.cc
+++ b/runtime/vm/parser.cc
@@ -1748,6 +1748,9 @@ AstNode* Parser::ParseInitializer(const Class& cls,
// "this" must not be accessible in initializer expressions.
receiver->set_invisible(true);
AstNode* init_expr = ParseConditionalExpr();
+ if (CurrentToken() == Token::kCASCADE) {
+ init_expr = ParseCascades(init_expr);
+ }
receiver->set_invisible(false);
SetAllowFunctionLiterals(saved_mode);
Field& field = Field::ZoneHandle(cls.LookupInstanceField(field_name));

Powered by Google App Engine
This is Rietveld 408576698