Commit b6264d6d authored by Leszek Swirski's avatar Leszek Swirski Committed by V8 LUCI CQ

[parser] Only post tasks when there is no error

We don't do scope analysis when there is a preparse error, so we don't
have a literal that is valid enough to create a SharedFunctionInfo.

Fixed: chromium:1267172
Change-Id: I18437889fb42593622410a44922bd9f0dc995992
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3263887
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Auto-Submit: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: 's avatarVictor Gomes <victorgomes@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77728}
parent a5700ffd
......@@ -2696,7 +2696,7 @@ FunctionLiteral* Parser::ParseFunctionLiteral(
RecordFunctionLiteralSourceRange(function_literal);
if (should_post_parallel_task) {
if (should_post_parallel_task && !has_error()) {
// Start a parallel parse / compile task on the compiler dispatcher.
Handle<SharedFunctionInfo> shared_info =
local_isolate_->factory()->NewSharedFunctionInfoForLiteral(
......
// Copyright 2021 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.
(function(){ 0, {}(); })();
0, function(){function(){ ; }(); ;
*%(basename)s:6: SyntaxError: Function statements require a function name
0, function(){function(){ ; }(); ;
^^^^^^^^
SyntaxError: Function statements require a function name
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