excluding features from sloppy mode

Brendan Eich brendan at mozilla.com
Sun Dec 30 03:21:50 PST 2012

Andreas Rossberg wrote:
> There
> also is the sloppy-mode-arguments-object vs destructuring issue.

Thanks, I forgot that one. It's a good point, since one cannot 
statically catch all 'arguments' uses in general.

Years ago we implemented destructuring parameters in JS1.7-1.8, without 
restricting arguments usage:

js> function f({x,y}, z) { arguments[0] = 42; return [x, y, z] }
js> f({x:1,y:2}, 3)
[1, 2, 3]
js> function f({x,y}, z) { arguments[1] = 42; return [x, y, z] }
js> f({x:1,y:2}, 3)
[1, 2, 42]

If bad old sloppy arguments objects are really important to preserve in 
functions that use destructuring, we can keep support.


More information about the es-discuss mailing list