Commit 7c3595ef authored by Toon Verwaest's avatar Toon Verwaest Committed by Commit Bot

[parser] Reparse arrow functions with unidentified syntax errors in the correct scope

Bug: chromium:919710
Change-Id: I5a04e76fbc925a89b0ebe1916637f6ae5d109b24
Reviewed-on: https://chromium-review.googlesource.com/c/1400419Reviewed-by: 's avatarLeszek Swirski <leszeks@chromium.org>
Commit-Queue: Toon Verwaest <verwaest@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58637}
parent 4ab96a9a
......@@ -3952,6 +3952,8 @@ ParserBase<Impl>::ParseArrowFunctionLiteral(
} else {
// In case we did not sucessfully preparse the function because of an
// unidentified error we do a full reparse to return the error.
// Parse again in the outer scope, since the language mode may change.
BlockState block_state(&scope_, scope()->outer_scope());
ExpressionT expression = ParseConditionalExpression();
DeclarationScope* function_scope = next_arrow_function_info_.scope;
FunctionState function_state(&function_state_, &scope_,
......
// Copyright 2019 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.
assertThrows("( let ) => { 'use strict'; let }", SyntaxError)
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