• keuchel@chromium.org's avatar
    Sync parser and preparser on do-while and return statements. · 410219c8
    keuchel@chromium.org authored
    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
    
    Review URL: http://codereview.chromium.org/8844002
    
    git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10201 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
    410219c8
Name
Last commit
Last update
benchmarks Loading commit data...
build Loading commit data...
include Loading commit data...
preparser Loading commit data...
samples Loading commit data...
src Loading commit data...
test Loading commit data...
tools Loading commit data...
.gitignore Loading commit data...
AUTHORS Loading commit data...
ChangeLog Loading commit data...
LICENSE Loading commit data...
LICENSE.strongtalk Loading commit data...
LICENSE.v8 Loading commit data...
LICENSE.valgrind Loading commit data...
Makefile Loading commit data...
SConstruct Loading commit data...