preventExtensions trap and its true/false protocol

David Bruant bruant.d at gmail.com
Sun Mar 31 11:02:49 PDT 2013


Hi,

The current proxy_spec [1], for the Object.preventExtensions built-in, 
suggests to read the result of the preventExtensions trap as a boolean 
and throw if falsy.
 From the developer perspective, this doesn't really add anything since 
it's already possible to throw from within the trap (and that's probably 
more explicit and clearer than returning false). This was pretty much 
agreed on in another recent thread (end of [2], then [3][4][5]).
Is it possible to remove this part? In the end, the trap return value 
would be just ignored.

David

[1] 
http://wiki.ecmascript.org/doku.php?id=harmony:proxies_spec#changes_to_es5_built-in_functions
[2] https://mail.mozilla.org/pipermail/es-discuss/2013-January/027999.html
[3] https://mail.mozilla.org/pipermail/es-discuss/2013-January/028000.html
[4] https://mail.mozilla.org/pipermail/es-discuss/2013-January/028001.html
[5] https://mail.mozilla.org/pipermail/es-discuss/2013-January/028122.html


More information about the es-discuss mailing list