-
adamk authored
Yield expressions are not allowed in formal parameter initializers of generators, but we weren't properly catching the case where the yield expression appeared in the 'extends' clause of a class expression. They also aren't allowed in arrow functions, which we were failing to catch due to not looking at the obscurely-named "FormalParameterInitializerError" bit of ExpressionClassifier. This patch passes along an ExpressionClassifier when parsing class expressions and accumulates the proper error for that case. For the arrow function case, the fix is simply to check for the "formal parameter initializer" error once we know we've parsed an arrow function. The error message used for this has also been made specific to yield expressions. Tests are added both for the error case and the non-error cases (where yield is used in such a position inside the class body). BUG=v8:4966, v8:4968, v8:4974 LOG=n Review-Url: https://codereview.chromium.org/1941823003 Cr-Commit-Position: refs/heads/master@{#35957}
9e9abcff