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

Unified Diff: runtime/vm/parser.cc

Issue 10392016: Fix issue 2939, revert previous change that accepted null as excpetion objects: (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 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
« no previous file with comments | « runtime/vm/exceptions.cc ('k') | 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
===================================================================
--- runtime/vm/parser.cc (revision 7471)
+++ runtime/vm/parser.cc (working copy)
@@ -5172,13 +5172,11 @@
// operator.
bool catch_seen = false;
bool generic_catch_seen = false;
- intptr_t catch_clause_count = 0;
SequenceNode* catch_handler_list = NULL;
const intptr_t handler_pos = token_index_;
OpenBlock(); // Start the catch block sequence.
current_block_->scope->AddLabel(end_catch_label);
while (CurrentToken() == Token::kCATCH) {
- catch_clause_count++;
catch_seen = true;
const intptr_t catch_pos = token_index_;
ConsumeToken(); // Consume the 'catch'.
@@ -5251,20 +5249,8 @@
AstNode* exception_var = new LoadLocalNode(catch_pos, *catch_excp_var);
AstNode* type_cond_expr = new ComparisonNode(
catch_pos, Token::kIS, exception_var, exception_type);
- if (catch_clause_count == 1) {
- // Null is also allowed, but check only in the first clause.
- AstNode* null_literal =
- new LiteralNode(catch_pos, Instance::ZoneHandle(Instance::null()));
- AstNode* null_cond_expr = new ComparisonNode(
- catch_pos, Token::kEQ_STRICT, exception_var, null_literal);
- AstNode* or_node = new BinaryOpNode(
- catch_pos, Token::kOR, null_cond_expr, type_cond_expr);
- current_block_->statements->Add(
- new IfNode(catch_pos, or_node, catch_handler, NULL));
- } else {
- current_block_->statements->Add(
- new IfNode(catch_pos, type_cond_expr, catch_handler, NULL));
- }
+ current_block_->statements->Add(
+ new IfNode(catch_pos, type_cond_expr, catch_handler, NULL));
} else {
// No exception type exists in the catch specifier so execute the
// catch handler code unconditionally.
« no previous file with comments | « runtime/vm/exceptions.cc ('k') | tests/co19/co19-runtime.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698