new function syntax and poison pill methods

Allen Wirfs-Brock allen at wirfs-brock.com
Fri Oct 26 11:47:34 PDT 2012


typos fixed in item 3 below

On Oct 26, 2012, at 10:37 AM, Allen Wirfs-Brock wrote:

> ES5 added "poison pill" properties to the strict mode function objects that were intended to prevent implementors from supporting the non-standard legacy "caller" and "arguments" properties on such objects.
> 
> In ES6 we have several new syntactic forms for defining functions: arrow functions, concise methods, generators.  What should be do WRT the position pill properties for functions defined using such new syntax.  Possibilities:
> 
> 1)  Same as ES5 function definitions.  If strict they get the poison pills , if non-strict they don't.
> 2)  All new function forms always get poison pills, even if they aren't strict.
> 3)  They never get poison pills because implementors >>wouldn't<<  be silly enough to associate these legacy features with new syntax.
> 
> Options 1&2 would essentially collapse to "always" if new function definition syntactic forms always produced strict mode code.  However, I believe, the current plan of record is that the new forms have the same strict mode opt-in rules as ES5 uses for function definitions.
> 
> Allen
> 
> _______________________________________________
> es-discuss mailing list
> es-discuss at mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss
> 



More information about the es-discuss mailing list