get/setIntegrity trap (Was: A case for removing the seal/freeze/isSealed/isFrozen traps)
Tom Van Cutsem
tomvc.be at gmail.com
Wed Feb 20 23:37:53 PST 2013
2013/2/20 Allen Wirfs-Brock <allen at wirfs-brock.com>
> Finally, I still think we should further consider the feasibly of a
> breaking change where
> Object.preventExtensions(obj); for ( let k of
> is no longer equivalent to
> in terms of causing Object.isFrozen(obj) to return false.
> I think I previously asked if anybody is aware of situations where
> Object.isFrozen tests are done but Object.freeze is not used to set objects
> to the frozen state. So far, no answers. Anybody?
I did a little code search via GitHub on uses of Object.isFrozen in JS
code. The large majority seems to occur in test cases (incl. Test262) or
libraries involving ES5 shims for ES3. There's no doubt this breaking
change will get noticed, as Test262 contains code such as:
However, here and there you can find some code that branches on frozenness,
although it's not always clear what the rationale behind it is, e.g.:
That said, I don't think this is enough evidence either for or against the
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the es-discuss