Function#arguments should be same as the standard arguments object

NEW
Unassigned

Status

()

Core
JavaScript Engine
5 years ago
3 years ago

People

(Reporter: emk, Unassigned)

Tracking

Trunk
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [js:t], URL)

(Reporter)

Description

5 years ago
Steps to reproduce:
var a = function(x, y, z) {
	return a.arguments === arguments;
};
a(1, 2, 3);

Actual result: false
Expected result: true
I'm not sure we actually want to fix this, given that I'm pretty sure this is the case specifically to implement various perf optimizations, and that .arguments is non-standard as well.

More generally, I have serious reservations about "standardizing", or even documenting, some of the things this "JavaScript spec" wants to standardize.  Except in the specific sections where there is clear agreement, I think we should ignore it, and I don't think we should file bugs on so-called "deviations" from it.

Comment 2

5 years ago
I agree with Jeff. Plus, I don't see any benefit from this "feature" and have never heard of any compat problems. 

WONTFIX please.

Comment 3

5 years ago
(In reply to Florian Bender from comment #2)
> I don't see any benefit from this "feature"

The obvious benefit would be interoperability. Most other major ECMAScript engines implement it as described here: http://javascript.spec.whatwg.org/#function.prototype.arguments Tests are available here: http://mathias.html5.org/tests/javascript/function/

Comment 4

5 years ago
If nobody (i. e. no web developers) uses it (and nobody should, it's a terrible feature which serves no real value*), there is no need for interop. 

* I'm open for real-life examples that make use of this feature (and cannot be solved otherwise) to revert my opinion. 

(In reply to Mathias Bynens from comment #3)
> Most other major ECMAScript engines implement it […]
Can you name them, please?
(Reporter)

Comment 5

5 years ago
(In reply to Florian Bender from comment #4)
> If nobody (i. e. no web developers) uses it (and nobody should, it's a
> terrible feature which serves no real value*), there is no need for interop. 
Let's remove the non-standard feature if really nobody uses it.
Then JavaScript spec author will gladly remove it from the spec.

> (In reply to Mathias Bynens from comment #3)
> > Most other major ECMAScript engines implement it […]
> Can you name them, please?
At least Chrome, IE10, Opera 12.10.

Comment 6

5 years ago
(In reply to Florian Bender from comment #4)
> > > Most other major ECMAScript engines implement it […]
> > Can you name them, please?
> At least Chrome, IE10, Opera 12.10.

Safari/JavaScriptCore, too.

Comment 7

5 years ago
(In reply to Masatoshi Kimura [:emk] from comment #5)
> Let's remove the non-standard feature if really nobody uses it.
> Then JavaScript spec author will gladly remove it from the spec.

Yeah, that's the way I'd choose. 


So, does anybody have any real-life examples where this is necessary? Wherever a web dev uses this feature, the web site should be broken in Fx (compared to other browsers). Any links (or workaround code that is necessary in any framework/toolkit for Fx support)?
FYI, IonMonkey is in some *rare* cases unable to fully recover “a.arguments”, so it might not even be equal to “a.arguments” when called with a different stack.
Whiteboard: [js:t]
(Assignee)

Updated

3 years ago
Assignee: general → nobody
You need to log in before you can comment on or make changes to this bug.