• Daniel Ehrenberg's avatar
    [parser] Prohibit async functions and generators in invalid contexts · ee15703e
    Daniel Ehrenberg authored
    Async functions and generator declarations are only permitted as
    StatementListItems, not as ExpressionStatements, and therefore not
    as the entire body of an if statement, etc. Previously, they were
    incorrectly permitted. However, ChakraCore and SpiderMonkey seem
    to ban them in this context, and the feature was introduced relatively
    recently, so it is likely to be web-compatible to ship the prohibition.
    
    This patch also unifies the error message wording of async functions
    and generators to ordinary functions, explaining more clearly what
    the issue is.
    
    Bug: v8:4483
    Cq-Include-Trybots: master.tryserver.v8:v8_linux_noi18n_rel_ng
    Change-Id: I31ed7818d6ab3e7e325031bfabb933dbf4512143
    Reviewed-on: https://chromium-review.googlesource.com/568979
    Commit-Queue: Daniel Ehrenberg <littledan@chromium.org>
    Reviewed-by: 's avatarAdam Klein <adamk@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#46770}
    ee15703e
Name
Last commit
Last update
..
OWNERS Loading commit data...
duplicate-finder.h Loading commit data...
expression-classifier.h Loading commit data...
func-name-inferrer.cc Loading commit data...
func-name-inferrer.h Loading commit data...
parameter-initializer-rewriter.cc Loading commit data...
parameter-initializer-rewriter.h Loading commit data...
parse-info.cc Loading commit data...
parse-info.h Loading commit data...
parser-base.h Loading commit data...
parser.cc Loading commit data...
parser.h Loading commit data...
parsing.cc Loading commit data...
parsing.h Loading commit data...
pattern-rewriter.cc Loading commit data...
preparse-data-format.h Loading commit data...
preparse-data.cc Loading commit data...
preparse-data.h Loading commit data...
preparsed-scope-data.cc Loading commit data...
preparsed-scope-data.h Loading commit data...
preparser.cc Loading commit data...
preparser.h Loading commit data...
rewriter.cc Loading commit data...
rewriter.h Loading commit data...
scanner-character-streams.cc Loading commit data...
scanner-character-streams.h Loading commit data...
scanner.cc Loading commit data...
scanner.h Loading commit data...
token.cc Loading commit data...
token.h Loading commit data...