Closed Bug 102093 Opened 23 years ago Closed 21 years ago

parameter named "arguments" is not accessible in JavaScript method

Categories

(Rhino Graveyard :: Core, defect)

x86
All
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: pschwartau, Assigned: norrisboyd)

Details

Attachments

(2 files)

This is the Rhino version of bug 94506 in SpiderMonkey, reported by 
deneen@alum.bucknell.edu:

The following code does not do what is expected:

function f(arguments)
{ 
  return arguments;
} 
f(5);


Actual Results:    [object Arguments]
Expected Results:  5


There is a testcase for this in the JS testsuite:

        mozilla/js/tests/ecma_3/Function/regress-94506.js


See bug 94506 for considerable discussion -
The patch adds to NativeCall constructor checks to ensure that arguments object
is only initialized if there is no function parameter with the same name.

I also split NativeCall that inherited from IdScriptable into NativeCall that
extends ScriptableObject and NativeCallPrototype that extends to make instances
of NativeCall smaller and to allow for faster property access since get/put/has
would not go throw an additional indirection level in IdScriptable.
I committed the fix
Status: NEW → RESOLVED
Closed: 21 years ago
Resolution: --- → FIXED
Due to the bug fix Rhino passing now ecma_3/Function/regress-94506.js so there
is no point to skip it. 

Phil, could you apply this?
Targeting as resolved against 1.5R5
Target Milestone: --- → 1.5R5
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: