archives

« Bugzilla Issues Index

#2774 — 9.2.14 Function Declaration Instantiation: "arguments" as function declaration not handled


9.2.14 Function Declaration Instantiation:

Executing the following test case results in an assertion error in CreateMutableBinding, because it attempts to redeclare "arguments".

I needed to update step 23 as follows:
---
23.
a. ...
b. ...
c. ...
d. ...
e. Else if needsParameterEnvironment is false then
i. Assert ao is undefined.
ii. Call env’s InitializeBinding concrete method passing "arguments" and ao as arguments.
iii. Append "arguments" to instantiatedVarNames.
f. Else
i. Assert ao is undefined.
ii. Call env’s InitializeBinding concrete method passing "arguments" and ao as arguments.
---

Obviously steps 23d-23f could be merged.


test case:
---
function f() {
function arguments() {}
}
f()
---


It looks to me that all we need to do is move what was (in rev24):
23.d.ii Append "arguments" to instantiatedVarNames.
up a level and make it 23.e

and then add after the rev25 step 26:

27. If needsSpecialArgumentsBinding is true and argumentsObjectNeeded is false, then
a. Call env’s InitializeBinding concrete method passing "arguments" and undefined as arguments.


fixed in rev25 editor's draft


fixed in rev25 editor's draft