Arguments object properties no longer alias arguments after the function returns

RESOLVED DUPLICATE of bug 478174

Status

()

RESOLVED DUPLICATE of bug 478174
9 years ago
7 years ago

People

(Reporter: jorendorff, Unassigned)

Tracking

Other Branch
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

9 years ago
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

Updated

9 years ago
Flags: wanted1.9.2?
(Reporter)

Comment 2

9 years ago
478174 has a nicer test case.
Status: NEW → RESOLVED
Last Resolved: 9 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 478174

Updated

7 years ago
Flags: wanted1.9.2?
You need to log in before you can comment on or make changes to this bug.