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

Issue 9159043: Fix handling of 'c: if (0) break c; else ()' where a parser optimization (Closed)

Created:
8 years, 10 months ago by Kevin Jones
Modified:
8 years, 10 months ago
CC:
v8-dev
Visibility:
Public.

Description

Fix handling of 'c: if (0) break c; else ()' where a parser optimization leaves a trailing ";" after removing the break. Committed: https://code.google.com/p/v8/source/detail?r=10628

Patch Set 1 #

Total comments: 1

Patch Set 2 : '' #

Total comments: 3

Patch Set 3 : '' #

Patch Set 4 : '' #

Unified diffs Side-by-side diffs Delta from patch set Stats (+43 lines, -0 lines) Patch
M src/parser.cc View 1 2 1 chunk +1 line, -0 lines 0 comments Download
A test/mjsunit/regress/regress-1924.js View 1 2 1 chunk +42 lines, -0 lines 0 comments Download

Messages

Total messages: 3 (0 generated)
Lasse Reichstein Nielsen
Consider adding a test for this. https://chromiumcodereview.appspot.com/9159043/diff/1/src/parser.cc File src/parser.cc (right): https://chromiumcodereview.appspot.com/9159043/diff/1/src/parser.cc#newcode2134 src/parser.cc:2134: } The semicolon ...
8 years, 10 months ago (2012-02-02 10:05:18 UTC) #1
Kevin Jones
On 2012/02/02 10:05:18, Lasse Reichstein Nielsen wrote: > Consider adding a test for this. > ...
8 years, 10 months ago (2012-02-03 18:44:18 UTC) #2
Lasse Reichstein Nielsen
8 years, 10 months ago (2012-02-03 20:11:13 UTC) #3
LGTM. Very good. I'll land it Monday, or possibly Tuesday.

https://chromiumcodereview.appspot.com/9159043/diff/4001/test/mjsunit/regress...
File test/mjsunit/regress/regress-1924.js (right):

https://chromiumcodereview.appspot.com/9159043/diff/4001/test/mjsunit/regress...
test/mjsunit/regress/regress-1924.js:33: assertThrows("a: break a
a",SyntaxError)
Space after comma (just for readability)

https://chromiumcodereview.appspot.com/9159043/diff/4001/test/mjsunit/regress...
test/mjsunit/regress/regress-1924.js:36: assertThrows("a: break a
var",SyntaxError)
Put a variable name after "var", otherwise it would be a syntax error anyway.

https://chromiumcodereview.appspot.com/9159043/diff/4001/test/mjsunit/regress...
test/mjsunit/regress/regress-1924.js:41: c: if (0) break c; else {}
You could also test the else branch (it also inherits the label).

Powered by Google App Engine
This is Rietveld 408576698