Commit e2bf6191 authored by Igor Sheludko's avatar Igor Sheludko Committed by Commit Bot

[parser] Fix spread properties parsing.

Bug: chromium:734395
Change-Id: Ieb45948f6efd2ccecd3d1ed761eb9e4614903480
Reviewed-on: https://chromium-review.googlesource.com/563661Reviewed-by: 's avatarAdam Klein <adamk@chromium.org>
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46546}
parent fba8b5cb
......@@ -2234,7 +2234,8 @@ typename ParserBase<Impl>::ExpressionT ParserBase<Impl>::ParsePropertyName(
}
case Token::ELLIPSIS:
if (allow_harmony_object_rest_spread()) {
if (allow_harmony_object_rest_spread() && !*is_generator && !*is_async &&
!*is_get && !*is_set) {
*name = impl()->EmptyIdentifier();
Consume(Token::ELLIPSIS);
expression = ParseAssignmentExpression(true, CHECK_OK);
......@@ -2255,6 +2256,7 @@ typename ParserBase<Impl>::ExpressionT ParserBase<Impl>::ParsePropertyName(
}
return expression;
}
// Fall-through.
default:
*name = ParseIdentifierName(CHECK_OK);
......
......@@ -7129,6 +7129,10 @@ TEST(ObjectSpreadNegativeTests) {
"{ ...var z = y}",
"{ ...var}",
"{ ...foo bar}",
"{* ...foo}",
"{get ...foo}",
"{set ...foo}",
"{async ...foo}",
NULL};
static const ParserFlag flags[] = {kAllowHarmonyObjectRestSpread};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment