archives

« Bugzilla Issues Index

#3047 — B.3.3 Web Legacy Block Function: Incorrect NOTE in step 2.a.i


B.3.3 Block-Level Function Declarations Web Legacy Compatibility Semantics, step 2.a.i

> NOTE A var binding for F is only instantiated here if it is not also a
> VarDeclaredName, the name of a formal parameter, or another
> FunctionDeclarations.


This note is not correct for functions with parameter expressions. If `hasParameterExpressions` is true, parameter names are not added to `instantiatedVarNames` which means step 2.a.ii in B.3.3 will create a new binding with the same name as a formal parameter.


Test case:
---
function f(p = 0) {
return typeof p;
{ function p() {} }
}
f(1); // Returns "undefined"

function g(p) {
return typeof p;
{ function p() {} }
}
g(1); // Returns "number"
---


fixed in rev27 editor's draft

also check parameterNames in 2.a.ii


fixed in rev27 draft