Commit bdd4a88f authored by Toon Verwaest's avatar Toon Verwaest Committed by Commit Bot

[parser] Restore RETURN_IF after export default var decl

Bug: chromium:900383, v8:8363, v8:7926
Change-Id: I6e3e38ee4cc986757926ef745d2e35865ba797a1
Reviewed-on: https://chromium-review.googlesource.com/c/1309633Reviewed-by: 's avatarIgor Sheludko <ishell@chromium.org>
Commit-Queue: Toon Verwaest <verwaest@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57158}
parent 4dff27ed
...@@ -1211,6 +1211,7 @@ Statement* Parser::ParseExportDefault() { ...@@ -1211,6 +1211,7 @@ Statement* Parser::ParseExportDefault() {
// no way of writing to it. // no way of writing to it.
Declaration* decl = Declaration* decl =
DeclareVariable(local_name, VariableMode::kConst, pos); DeclareVariable(local_name, VariableMode::kConst, pos);
RETURN_IF_PARSE_ERROR;
decl->proxy()->var()->set_initializer_position(position()); decl->proxy()->var()->set_initializer_position(position());
Assignment* assignment = factory()->NewAssignment( Assignment* assignment = factory()->NewAssignment(
......
// Copyright 2018 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// MODULE
export default x = 1;
export default x = 1;
*%(basename)s:8: SyntaxError: Identifier '*default*' has already been declared
export default x = 1;
^
SyntaxError: Identifier '*default*' has already been declared
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