archives

« Bugzilla Issues Index

#2873 — B.3.2 Web Block Function Decl: Redeclaration checks when parameter environment is present


B.3.2 Web Legacy Compatibility for Block-Level Function Declarations

The redeclaration check in step 2.a does not take parameter environments into account. Maybe it should use `instantiatedVarNames` instead of HasBinding()?

Also: Step reference in B.3.2, step 2a. to 9.2.14 needs to be updated from step 26 to step 29.


Parameter environment present:
---
function f(a = () => "default") {
if (true) { function a() { return "web-compat" } }
return a();
}
f(); // returns "web-compat"
f(() => "param"); returns "web-compat"
---


Parameter environment not present:
---
function f(a) {
if (true) { function a() { return "web-compat" } }
return a();
}
f(); // throws TypeError
f(() => "param"); // returns "param"
---


fixed in rev25 editor's draft.

used instantiatedVarNames. Also adjusted the step reference into 9.2.14


fixed in rev25 editor's draft