archives

« Bugzilla Issues Index

#2643 — 9.2.14 Function Declaration Instantiation: Bindings for function declarations not created


9.2.14 Function Declaration Instantiation.

Step 30 calls ResolveBinding() for function declaration names, but the bindings were never created in the first place.

My current implementation uses instead:
---
For each production f in functionsToInitialize, do

1. Let fn be the sole element of the BoundNames of f

2. Let fo be the result of performing InstantiateFunctionObject for f with argument env.

3. If needsArgumentsBinding is true and fn is "arguments" and needsParameterEnvironment is false, then
3.a Call env.SetMutableBinding(fn, fo, strict)

4. Else If parameterNames contains fn and needsParameterEnvironment is false, then
4.a Call env.SetMutableBinding(fn, fo, strict)

5. Else
5.a Call env.CreateMutableBinding(fn, false)
5.b Call env.InitializeBinding(fn, fo)

---


Step 28 instead of step 30.


fixed in rev24 editor's draft

Now function names are not removed from varNames, so the the varNames instantiation loop will create the function bindings. that was what I had originally intended.


fixed in rev24