• Mathias Bynens's avatar
    [parser] Improve error message for `import()` · dbcea115
    Mathias Bynens authored
    Currently, dynamic `import()` throws the following SyntaxError when
    used without a specifier:
    
        > import();
        < Uncaught SyntaxError: Unexpected token )
    
    From the error message, it seems this the result of the code snippet
    being seen as static `import` followed by parens, as opposed to
    `import()` with no specifier.
    
    This patch makes this error message more clear:
    
        > import();
        < SyntaxError: import() requires a specifier
    
    BUG=v8:7020,v8:6513
    
    Change-Id: I3519dfd0029f38d23da858a5499f1d226e794935
    Reviewed-on: https://chromium-review.googlesource.com/747141Reviewed-by: 's avatarSathya Gunasekaran <gsathya@chromium.org>
    Commit-Queue: Mathias Bynens <mathias@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#49058}
    dbcea115
Name
Last commit
Last update
..
benchmarks Loading commit data...
cctest Loading commit data...
common Loading commit data...
debugger Loading commit data...
fuzzer Loading commit data...
inspector Loading commit data...
intl Loading commit data...
js-perf-test Loading commit data...
memory Loading commit data...
message Loading commit data...
mjsunit Loading commit data...
mkgrokdump Loading commit data...
mozilla Loading commit data...
preparser Loading commit data...
promises-aplus Loading commit data...
test262 Loading commit data...
unittests Loading commit data...
wasm-spec-tests Loading commit data...
webkit Loading commit data...
BUILD.gn Loading commit data...
bot_default.gyp Loading commit data...
bot_default.isolate Loading commit data...
default.gyp Loading commit data...
default.isolate Loading commit data...
optimize_for_size.gyp Loading commit data...
optimize_for_size.isolate Loading commit data...
perf.gyp Loading commit data...
perf.isolate Loading commit data...