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

Unified Diff: runtime/vm/parser.cc

Issue 1540673002: Move super initializer to end of list (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years 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 | « no previous file | tests/co19/co19-runtime.status » ('j') | tests/co19/co19-runtime.status » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/parser.cc
diff --git a/runtime/vm/parser.cc b/runtime/vm/parser.cc
index 15393a0d0b41b74017becaeb4d9af45f9354077c..747a367ffeb92b219705da7ca3b9033fb89468fa 100644
--- a/runtime/vm/parser.cc
+++ b/runtime/vm/parser.cc
@@ -48,7 +48,9 @@ DEFINE_FLAG(bool, load_deferred_eagerly, false,
DEFINE_FLAG(bool, trace_parser, false, "Trace parser operations.");
DEFINE_FLAG(bool, warn_mixin_typedef, true, "Warning on legacy mixin typedef.");
DEFINE_FLAG(bool, link_natives_lazily, false, "Link native calls lazily");
-DEFINE_FLAG(bool, move_super, false, "Move super initializer to end of list");
+DEFINE_FLAG(bool, move_super, true, "Move super initializer to end of list.");
+DEFINE_FLAG(bool, warn_super, false,
+ "Warning if super initializer not last in initializer list.");
DECLARE_FLAG(bool, lazy_dispatchers);
DECLARE_FLAG(bool, load_deferred_eagerly);
@@ -2816,7 +2818,9 @@ void Parser::ParseInitializers(const Class& cls,
// A(x) : super(x), f = x++ { ... }
// is transformed to:
// A(x) : temp = x, f = x++, super(temp) { ... }
- ReportWarning("Super initizlizer not at end");
+ if (FLAG_warn_super) {
+ ReportWarning("Super initizlizer not at end");
+ }
ASSERT(super_init_index >= 0);
ArgumentListNode* ctor_args = super_init_call->arguments();
LetNode* saved_args = new(Z) LetNode(super_init_call->token_pos());
« no previous file with comments | « no previous file | tests/co19/co19-runtime.status » ('j') | tests/co19/co19-runtime.status » ('J')

Powered by Google App Engine
This is Rietveld 408576698