• littledan's avatar
    Improve parsing errors related to destructuring bind · 9d6ab46a
    littledan authored
    For destructuring bind, the parser needs to complain about things
    which are inappropriate to have on the left-hand side.
    
    Previously, regexp literals and template literals were let through
    the parser inappropriately. This patch turns those into errors.
    
    This patch also fixes off-by-one errors in reporting the location
    of this type of error for strings and numbers. Before the patch,
    the error would look like:
    
    d8> var {x: 3} = {x: 4}
    (d8):1: SyntaxError: Unexpected number
    var {x: 3} = {x: 4}
          ^
    SyntaxError: Unexpected number
    
    And with the patch, the error is
    
    d8> var {x: 3} = {x: 4}
    (d8):1: SyntaxError: Unexpected number
    var {x: 3} = {x: 4}
            ^
    SyntaxError: Unexpected number
    
    R=rossberg
    
    Review URL: https://codereview.chromium.org/1236803003
    
    Cr-Commit-Position: refs/heads/master@{#29661}
    9d6ab46a
Name
Last commit
Last update
benchmarks Loading commit data...
build Loading commit data...
include Loading commit data...
infra Loading commit data...
samples Loading commit data...
src Loading commit data...
test Loading commit data...
testing Loading commit data...
third_party/binutils Loading commit data...
tools Loading commit data...
.clang-format Loading commit data...
.gitignore Loading commit data...
.ycm_extra_conf.py Loading commit data...
AUTHORS Loading commit data...
BUILD.gn Loading commit data...
ChangeLog Loading commit data...
DEPS 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...
Makefile.android Loading commit data...
Makefile.nacl Loading commit data...
OWNERS Loading commit data...
PRESUBMIT.py Loading commit data...
README.md Loading commit data...
WATCHLISTS Loading commit data...
codereview.settings Loading commit data...