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

@ -0,0 +1,16 @@
// Annex B.3.3.1 disallows Annex B lexical function behavior when redeclaring a
// parameter.
(function(f) {
if (true) function f() { }
assertEq(f, 123);
}(123));
(function(f) {
{ function f() { } }
assertEq(f, 123);
}(123));
if (typeof reportCompare === "function")
reportCompare(true, true);

View file

@ -20,7 +20,7 @@ function test()
printBugNumber(BUGNUMBER);
printStatus (summary);
expect = 'function x() {}';
expect = '1';
function g(x) { if (1) function x() {} return x; }
print(actual = g(1) + '');

View file

@ -32,7 +32,7 @@ function test()
var r = f(0);
if (typeof(r[0]) != "function")
if (typeof(r[0]) != "number")
actual += "Bad r[0]";
if (typeof(r[1]) != "function")