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

Unified Diff: src/parser.cc

Issue 9159043: Fix handling of 'c: if (0) break c; else ()' where a parser optimization (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 8 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/parser.cc
===================================================================
--- src/parser.cc (revision 10553)
+++ src/parser.cc (working copy)
@@ -2128,6 +2128,10 @@
// Parse labeled break statements that target themselves into
// empty statements, e.g. 'l1: l2: l3: break l2;'
if (!label.is_null() && ContainsLabel(labels, label)) {
+ // Consume the 'break' SEMICOLON if present
+ if (peek() == Token::SEMICOLON) {
+ scanner().Next();
+ }
Lasse Reichstein Nielsen 2012/02/02 10:05:19 The semicolon *must* be there (or be inserted by a
return EmptyStatement();
}
BreakableStatement* target = NULL;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698