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

Unified Diff: runtime/vm/parser.cc

Issue 10910060: Disable all support for legacy try-catch in the VM. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 3 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 | « no previous file | tests/co19/co19-runtime.status » ('j') | no next file with comments »
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 5897895fc9961252086e2799193d5a829faf9fad..8e03ec1a44891855b4d22472e483a4fcc56c9fd3 100644
--- a/runtime/vm/parser.cc
+++ b/runtime/vm/parser.cc
@@ -27,7 +27,6 @@ DEFINE_FLAG(bool, enable_type_checks, false, "Enable type checks.");
DEFINE_FLAG(bool, trace_parser, false, "Trace parser operations.");
DEFINE_FLAG(bool, warning_as_error, false, "Treat warnings as errors.");
DEFINE_FLAG(bool, silent_warnings, false, "Silence warnings.");
-DEFINE_FLAG(bool, warn_legacy_catch, false, "Warning on legacy catch syntax");
DEFINE_FLAG(bool, warn_legacy_map_literal, false,
"Warning on legacy map literal syntax (single type argument)");
@@ -5759,22 +5758,18 @@ AstNode* Parser::ParseTryStatement(String* label_name) {
if (CurrentToken() == Token::kCOMMA) {
ConsumeToken();
stack_trace_param.is_final = true;
- // TODO(hausner): Make imlicit type be StackTrace, not Dynamic.
+ // TODO(hausner): Make implicit type be StackTrace, not Dynamic.
stack_trace_param.type =
&AbstractType::ZoneHandle(Type::DynamicType());
stack_trace_param.token_pos = TokenPos();
stack_trace_param.var = ExpectIdentifier("identifier expected");
}
} else {
- // TODO(hausner): Remove legacy syntax support.
- if (FLAG_warn_legacy_catch) {
- Warning("legacy catch syntax");
- }
- ParseCatchParameter(&exception_param);
- if (CurrentToken() == Token::kCOMMA) {
- ConsumeToken();
- ParseCatchParameter(&stack_trace_param);
- }
+ // TODO(hausner): Improve error message and maybe also the
+ // structure of the code. Maybe you can get away with simply
+ // expecting an identifier followed by a comma or a right
+ // parenthesis?
+ ErrorMsg("identifier expected here, not type, final, or var");
}
} else {
// on T catch(e) { ...
« no previous file with comments | « no previous file | tests/co19/co19-runtime.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698