diff --git a/src/parsing/parser-base.h b/src/parsing/parser-base.h index 3bd313e68c..52023611e4 100644 --- a/src/parsing/parser-base.h +++ b/src/parsing/parser-base.h @@ -3710,6 +3710,7 @@ void ParserBase::ParseFormalParameter(FormalParametersT* parameters, // BindingElement[?Yield, ?GeneratorParameter] bool is_rest = parameters->has_rest; + FuncNameInferrer::State fni_state(fni_); ExpressionT pattern = ParsePrimaryExpression(CHECK_OK_CUSTOM(Void)); ValidateBindingPattern(CHECK_OK_CUSTOM(Void)); diff --git a/test/message/fail/func-name-inferrer-arg-1.js b/test/message/fail/func-name-inferrer-arg-1.js new file mode 100644 index 0000000000..6c28367d92 --- /dev/null +++ b/test/message/fail/func-name-inferrer-arg-1.js @@ -0,0 +1,10 @@ +// Copyright 2017 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 (param = function() { throw new Error('boom') }) { + (() => { + param(); + })(); + +})(); diff --git a/test/message/fail/func-name-inferrer-arg-1.out b/test/message/fail/func-name-inferrer-arg-1.out new file mode 100644 index 0000000000..3c19121a0a --- /dev/null +++ b/test/message/fail/func-name-inferrer-arg-1.out @@ -0,0 +1,8 @@ +*%(basename)s:5: Error: boom +(function (param = function() { throw new Error('boom') }) { + ^ +Error: boom + at param (*%(basename)s:5:39) + at *%(basename)s:7:5 + at *%(basename)s:8:5 + at *%(basename)s:10:3 \ No newline at end of file diff --git a/test/message/fail/func-name-inferrer-arg.js b/test/message/fail/func-name-inferrer-arg.js new file mode 100644 index 0000000000..3fcd044b9b --- /dev/null +++ b/test/message/fail/func-name-inferrer-arg.js @@ -0,0 +1,10 @@ +// Copyright 2017 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 (param) { + (() => { + throw new Error('boom'); + })(); + +})(); diff --git a/test/message/fail/func-name-inferrer-arg.out b/test/message/fail/func-name-inferrer-arg.out new file mode 100644 index 0000000000..06e001d1d5 --- /dev/null +++ b/test/message/fail/func-name-inferrer-arg.out @@ -0,0 +1,7 @@ +*%(basename)s:7: Error: boom + throw new Error('boom'); + ^ +Error: boom + at *%(basename)s:7:11 + at *%(basename)s:8:5 + at *%(basename)s:10:3 \ No newline at end of file