Skip to content

Commit 3a648b7

Browse files
targosMylesBorins
authored andcommitted
deps: cherry-pick c3458a8 from upstream V8
Original commit message: [parser] Add new FunctionNameInferrer state before parsing param Create new state before parsing FormalParameter because we don't want to use any of the parameters as an inferred function name. Previously the stacktrace was: test.js:3: Error: boom throw new Error('boom'); ^ Error: boom at param (test.js:3:11) at test.js:4:5 at test.js:6:3 The stacktrace with this patch: test.js:3: Error: boom throw new Error('boom'); ^ Error: boom at test.js:3:11 at test.js:4:5 at test.js:6:3 Bug: v8:6822, v8:6513 Change-Id: Ifbadc660fc4e85248af405acd67c025f11662bd4 Reviewed-on: https://chromium-review.googlesource.com/742657 Reviewed-by: Adam Klein <adamk@chromium.org> Commit-Queue: Sathya Gunasekaran <gsathya@chromium.org> Cr-Commit-Position: refs/heads/master@{#49042} PR-URL: #18059 Closes: #15386 Fixes: #15386 Refs: v8/v8@c3458a8 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
1 parent 4746bbf commit 3a648b7

6 files changed

+37
-1
lines changed

deps/v8/include/v8-version.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#define V8_MAJOR_VERSION 6
1212
#define V8_MINOR_VERSION 1
1313
#define V8_BUILD_NUMBER 534
14-
#define V8_PATCH_LEVEL 50
14+
#define V8_PATCH_LEVEL 51
1515

1616
// Use 1 for candidates and 0 otherwise.
1717
// (Boolean macro values are not supported by all preprocessors.)

deps/v8/src/parsing/parser-base.h

+1
Original file line numberDiff line numberDiff line change
@@ -3573,6 +3573,7 @@ void ParserBase<Impl>::ParseFormalParameter(FormalParametersT* parameters,
35733573
// BindingElement[?Yield, ?GeneratorParameter]
35743574
bool is_rest = parameters->has_rest;
35753575

3576+
FuncNameInferrer::State fni_state(fni_);
35763577
ExpressionT pattern = ParsePrimaryExpression(CHECK_OK_CUSTOM(Void));
35773578
ValidateBindingPattern(CHECK_OK_CUSTOM(Void));
35783579

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// Copyright 2017 the V8 project authors. All rights reserved.
2+
// Use of this source code is governed by a BSD-style license that can be
3+
// found in the LICENSE file.
4+
5+
(function (param = function() { throw new Error('boom') }) {
6+
(() => {
7+
param();
8+
})();
9+
10+
})();
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
*%(basename)s:5: Error: boom
2+
(function (param = function() { throw new Error('boom') }) {
3+
^
4+
Error: boom
5+
at param (*%(basename)s:5:39)
6+
at *%(basename)s:7:5
7+
at *%(basename)s:8:5
8+
at *%(basename)s:10:3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// Copyright 2017 the V8 project authors. All rights reserved.
2+
// Use of this source code is governed by a BSD-style license that can be
3+
// found in the LICENSE file.
4+
5+
(function (param) {
6+
(() => {
7+
throw new Error('boom');
8+
})();
9+
10+
})();
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
*%(basename)s:7: Error: boom
2+
throw new Error('boom');
3+
^
4+
Error: boom
5+
at *%(basename)s:7:11
6+
at *%(basename)s:8:5
7+
at *%(basename)s:10:3

0 commit comments

Comments
 (0)