mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-11-01 12:07:34 +09:00
1317374 - Don't do Annex B lexical function behavior when redeclaring a parameter name.
This commit is contained in:
parent
146dbe7bee
commit
8350dfc515
5 changed files with 27 additions and 3 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue