Object.define ==> Object.mixin??

Brandon Benvie brandon at brandonbenvie.com
Wed Dec 12 10:31:07 PST 2012


Yeah, it makes sense. If a property throws then you're going to end up with
a partially completed action either way (unless the very first one fails in
the ES5 rules), so it's better to fail predictably. While the iteration
order of the keys is defined, in this case it's usually not useful for
ending up in a predictable end state in the face of errors.


On Wed, Dec 12, 2012 at 1:18 PM, Allen Wirfs-Brock <allen at wirfs-brock.com>wrote:

>
> On Dec 12, 2012, at 10:05 AM, Brandon Benvie wrote:
>
> All the Object functions that operate on multiple properties are currently
> specified using *pendingException* which reports the first thrown
> exception after going through all the properties. defineProperties, freeze,
> etc.
>
>
> In, ES6.  This is a breaking (hopefully nothing) change from ES5 that was
> suggested by Mark Miller.
>
> The desire is to decrease the non-determinism that an early throw
> introduces.  In the ES6 approach all property updates that can occur will
> occur, before the exception is thrown instead of leaving the object in a
> less well defined partially updated state.
>
> Allen
>
>
>
>
> _______________________________________________
> es-discuss mailing list
> es-discuss at mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20121212/5004bed8/attachment.html>


More information about the es-discuss mailing list