Closed
Bug 1133298
Opened 8 years ago
Closed 8 years ago
'arguments' is allowed even with rest-parameters
Categories
(Core :: JavaScript Engine, defect)
Core
JavaScript Engine
Tracking
()
RESOLVED
FIXED
mozilla43
People
(Reporter: 446240525, Assigned: jandem)
References
Details
(Keywords: dev-doc-complete, Whiteboard: [DocArea=JS])
js> (function(...args){return arguments})(1,2,3) SyntaxError: 'arguments' object may not be used in conjunction with a rest parameter // should be { "0": 1, "1": 2, "2": 3 }
Comment 1•8 years ago
|
||
This is what the spec says, but I still have hopes of arguing people away from this. There's no good reason to have this doubling of work (...in the cases that can't be optimized away, at least), and at least a few reasons against -- particularly, that with a rest parameter the aliasing of parameters and arguments[i] indexes (when at least that many arguments are passed) becomes somewhat non-obvious (although I don't know if the spec handles it unambiguously or not). So I think we should hold the fire on this one for at least a moment.
Assignee | ||
Comment 2•8 years ago
|
||
Fixed by bug 889158. There's still bug 1175394 though but that's a separate issue.
Assignee: nobody → jdemooij
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla43
Comment 3•8 years ago
|
||
Review appreciated. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/arguments#Rest_default_and_destructured_parameters https://developer.mozilla.org/en-US/Firefox/Releases/43#JavaScript
Keywords: dev-doc-needed → dev-doc-complete
Assignee | ||
Comment 4•8 years ago
|
||
(In reply to Florian Scholz [:fscholz] from comment #3) > https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/ > arguments#Rest_default_and_destructured_parameters > https://developer.mozilla.org/en-US/Firefox/Releases/43#JavaScript Thanks for updating the docs for all those bugs.
You need to log in
before you can comment on or make changes to this bug.
Description
•