Closed Bug 511998 Opened 15 years ago Closed 14 years ago

Arguments object properties no longer alias arguments after the function returns

Categories

(Core :: JavaScript Engine, defect)

Other Branch
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 478174

People

(Reporter: jorendorff, Unassigned)

Details

var get, put;
function f(a) {
    var args = arguments;
    get = function () { return a;};
    put = function (x) { args[0] = x; };
}
f('old');
put('new');
assertEq(get(), 'new');

When f returns, we call js_PutCallObject and js_PutArgsObject, and separate copies of the locals are stored in the two objects. put() only affects arguments, not the Call object.

I think ES3 requires `arguments[0]` and `a` to keep aliasing forever.
Yes, ES3 does specify that.

Richard Cornford pointed this out here:

https://mail.mozilla.org/pipermail/es-discuss/2008-July/006618.html

I forgot to file a bug. Kind of on purpose :-P.

/be
Flags: wanted1.9.2?
478174 has a nicer test case.
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → DUPLICATE
Flags: wanted1.9.2?
You need to log in before you can comment on or make changes to this bug.