archives

« Bugzilla Issues Index

#3204 — B.3.3 Block-Level Function Declarations: Missing variable binding when parameter with same name as function is present


B.3.3 Block-Level Function Declarations Web Legacy Compatibility Semantics

The resolution for bug 3047 is incorrect, excluding parameterNames in step 2.a.ii leads to an assertion in this code:
---
function f(g=0) { { function g(){} } } f()
---

When step 2.b.5 calls SetMutableBinding, no binding is present, so the assertion in SetMutableBinding fails.


(In reply to André Bargull from comment #0)

> ---
> function f(g=0) { { function g(){} } } f()
> ---

Note that your use of f and g in the test case is reversed form the usage in B.3.3. the test would be easier to related to the algorithm if you wrote it as:

function g(f=0) { { function f(){} } } g()


fixed in rev28 editor's draft.

If an otherwise eligible inner function has the same name is a formal parameter then we should be doing this hack at all, as that case does have interoperable legacy web semantics.

So, the fix is to back out the change done for bug 3027 and to add an additional predicate to step 2: "and F is not an element of BoundNames of FormalParameters of g"


fixed in rev28