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

Issue 6355006: Make invalid break/continue statements an early syntax error. (Closed)

Created:
9 years, 11 months ago by Lasse Reichstein
Modified:
9 years, 6 months ago
CC:
v8-dev
Visibility:
Public.

Description

Make invalid break/continue statements an early syntax error. Previously we delayed the throwing of syntax errors until runtime, so unreachable errors didn't get reported. To match a change in JSC, we now stop parsing and report the error immediately. BUG=69736 TEST= Committed: http://code.google.com/p/v8/source/detail?r=6341

Patch Set 1 #

Total comments: 8

Patch Set 2 : Address review comments. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+59 lines, -27 lines) Patch
M src/parser.h View 1 chunk +3 lines, -0 lines 0 comments Download
M src/parser.cc View 1 4 chunks +37 lines, -13 lines 0 comments Download
M test/mjsunit/delay-syntax-error.js View 1 1 chunk +9 lines, -8 lines 0 comments Download
M test/mjsunit/regress/regress-1036894.js View 1 chunk +5 lines, -5 lines 0 comments Download
M test/mjsunit/regress/regress-990205.js View 1 1 chunk +5 lines, -1 line 0 comments Download

Messages

Total messages: 3 (0 generated)
Lasse Reichstein
9 years, 11 months ago (2011-01-17 09:19:53 UTC) #1
Mads Ager (chromium)
LGTM http://codereview.chromium.org/6355006/diff/1/src/parser.cc File src/parser.cc (right): http://codereview.chromium.org/6355006/diff/1/src/parser.cc#newcode795 src/parser.cc:795: source_location.beg_pos, source_location.end_pos); I find one argument per line ...
9 years, 11 months ago (2011-01-17 09:29:13 UTC) #2
Lasse Reichstein
9 years, 11 months ago (2011-01-17 09:34:08 UTC) #3
http://codereview.chromium.org/6355006/diff/1/src/parser.cc
File src/parser.cc (right):

http://codereview.chromium.org/6355006/diff/1/src/parser.cc#newcode795
src/parser.cc:795: source_location.beg_pos, source_location.end_pos);
Fixed here and above.

http://codereview.chromium.org/6355006/diff/1/test/mjsunit/delay-syntax-error.js
File test/mjsunit/delay-syntax-error.js (right):

http://codereview.chromium.org/6355006/diff/1/test/mjsunit/delay-syntax-error...
test/mjsunit/delay-syntax-error.js:30: // CHANGED in Jan. 2011. JSC switched to
reporting these syntax errors
Done.

http://codereview.chromium.org/6355006/diff/1/test/mjsunit/delay-syntax-error...
test/mjsunit/delay-syntax-error.js:36: // Do throw syntax errors for illegal
break and continue at compile time.
Done.

http://codereview.chromium.org/6355006/diff/1/test/mjsunit/regress/regress-99...
File test/mjsunit/regress/regress-990205.js (right):

http://codereview.chromium.org/6355006/diff/1/test/mjsunit/regress/regress-99...
test/mjsunit/regress/regress-990205.js:28: // We not throw syntax errors early
for invalid break and continue
Should have been "We now". Changed to just "We".

Powered by Google App Engine
This is Rietveld 408576698