1317374 - Don't do Annex B lexical function behavior when redeclaring a parameter name.

This commit is contained in:
Gaming4JC 2019-06-08 16:37:10 -04:00 • committed by Roy Tam
commit 8350dfc515
5 changed files with 27 additions and 3 deletions

View file

@ -8,9 +8,11 @@ assertEq(typeof f1(true), "function");
assertEq(f1(false), 3);
function f2(b, w) {
// Annex B doesn't apply to functions in blocks with the same name as a
// parameter.
if (b)
function w() {}
return w;
}
assertEq(typeof f2(true, 3), "function");
assertEq(typeof f2(true, 3), "number");
assertEq(f2(false, 3), 3);