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

Issue 8844002: Sync parser and preparser on do-while and return statements. (Closed)

Created:
9 years ago by Steven
Modified:
9 years ago
Reviewers:
Yang
CC:
v8-dev
Visibility:
Public.

Description

Sync parser and preparser on do-while and return statements. This CL fixes the preparser to have the same liberal automatic semicolon insertion behaviour as the parser. In the case of a return statement in global code we throw a syntax error at runtime rather than an early error due to compatibility with KJS. However that hack allowed the following syntactically incorrect program in global code in the parser but not in the preparser: if (false) return else {} while the slightly saner version with the obligatory semicolon if (false) return; else {} was disallowed in the parser, but the preparser allowed it. This CL also fixes that issue. BUG=v8:1856 TEST=cctest/test-parsing.cc Committed: http://code.google.com/p/v8/source/detail?r=10201

Patch Set 1 #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+214 lines, -13 lines) Patch
M src/parser.cc View 2 chunks +15 lines, -13 lines 0 comments Download
M src/preparser.cc View 1 chunk +1 line, -0 lines 0 comments Download
M test/cctest/test-parsing.cc View 1 chunk +198 lines, -0 lines 4 comments Download

Messages

Total messages: 4 (0 generated)
Steven
PTAL.
9 years ago (2011-12-07 15:32:22 UTC) #1
Yang
On 2011/12/07 15:32:22, Steven wrote: > PTAL. LGTM with nits.
9 years ago (2011-12-07 15:59:22 UTC) #2
Yang
Forgot to send the nits... http://codereview.chromium.org/8844002/diff/1/test/cctest/test-parsing.cc File test/cctest/test-parsing.cc (right): http://codereview.chromium.org/8844002/diff/1/test/cctest/test-parsing.cc#newcode976 test/cctest/test-parsing.cc:976: Presubmit check says test/cctest/test-parsing.cc:975: ...
9 years ago (2011-12-07 15:59:33 UTC) #3
Steven
9 years ago (2011-12-07 16:03:08 UTC) #4
http://codereview.chromium.org/8844002/diff/1/test/cctest/test-parsing.cc
File test/cctest/test-parsing.cc (right):

http://codereview.chromium.org/8844002/diff/1/test/cctest/test-parsing.cc#new...
test/cctest/test-parsing.cc:976: 
On 2011/12/07 15:59:33, Yang wrote:
> Presubmit check says
> 
> test/cctest/test-parsing.cc:975:  Using sizeof(type).  Use sizeof(varname)
> instead if possible  [runtime/sizeof] [1]

Done.

http://codereview.chromium.org/8844002/diff/1/test/cctest/test-parsing.cc#new...
test/cctest/test-parsing.cc:1071: int length = i::OS::SNPrintF( program,
On 2011/12/07 15:59:33, Yang wrote:
> Presubmit says
> 
> test/cctest/test-parsing.cc:1071:  Extra space after ( in function call 
> [whitespace/parens] [4]

Done.

Powered by Google App Engine
This is Rietveld 408576698