Continuing woes in reading the ES6 spec language

Brandon Benvie bbenvie at mozilla.com
Thu Sep 12 13:42:32 PDT 2013


On 9/12/2013 12:45 PM, Oliver Hunt wrote:
>  From talking to SpiderMonkey folk it sounds like SM nukes the |arguments| identifier entirely if you use any of the new parameter logic (deconstruction, defaults, or rest params).  I would be happy with that.

This doesn't seem to be accurate, or I'm not understanding what you're 
saying. In SpiderMonkey, I see:

```js
function argsAsDefault(x = arguments){
   return x;
}
argsAsDefault(); // returns 0 length Arguments object


function ignoreDestructuredParam({ x }){
   return arguments;
}
ignoreDestructuredParam({ x: 10 }); // returns 1 length Arguments object


function restArgs(...rest){
   return arguments;
}
restArgs(1, 2, 3); // SyntaxError: 'arguments' object may not be used in 
conjunction with a rest parameter
```


More information about the es-discuss mailing list