Closed
Bug 815014
Opened 13 years ago
Closed 6 years ago
Function#arguments should be same as the standard arguments object
Categories
(Core :: JavaScript Engine, defect)
Core
JavaScript Engine
Tracking
()
RESOLVED
INVALID
People
(Reporter: emk, Unassigned)
References
(Blocks 1 open bug, )
Details
(Whiteboard: [js:t])
Steps to reproduce:
var a = function(x, y, z) {
return a.arguments === arguments;
};
a(1, 2, 3);
Actual result: false
Expected result: true
Comment 1•13 years ago
|
||
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•13 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•13 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•13 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•13 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•13 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•13 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)?
Comment 8•13 years ago
|
||
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.
Updated•13 years ago
|
Whiteboard: [js:t]
| Assignee | ||
Updated•12 years ago
|
Assignee: general → nobody
Comment 9•6 years ago
|
||
(In reply to Masatoshi Kimura [:emk] from comment #0)
var a = function(x, y, z) {
return a.arguments === arguments;
};
a(1, 2, 3);Actual result: false
That behaviour is shared by other mainstream browsers, and it is expected to be standardised that way.
Therefore, this is Working as intended per Bug 1615704.
Flags: needinfo?(evilpies)
Updated•6 years ago
|
Blocks: 1615704
Status: NEW → RESOLVED
Closed: 6 years ago
Flags: needinfo?(evilpies)
Resolution: --- → WORKSFORME
Updated•6 years ago
|
Resolution: WORKSFORME → INVALID
You need to log in
before you can comment on or make changes to this bug.
Description
•