• 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
messages.h 47.5 KB