Object.define ==> Object.mixin??

Brandon Benvie brandon at brandonbenvie.com
Wed Dec 12 10:33:20 PST 2012


In order to know what the end state will be for any given property, you
currently need to know whether every preceding property throws or not. With
the ES6 change, there's no interdependence between properties as to whether
they'll end up being visited or not.


On Wed, Dec 12, 2012 at 1:23 PM, John J Barton
<johnjbarton at johnjbarton.com>wrote:

>
>
>
> On Wed, Dec 12, 2012 at 10:18 AM, 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.
>>
>
> How can multiple calls to Object.mixin with identical state result in
> different results?
>
>
>> 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.
>>
>
> If an exception is thrown because of an error in Object.mixin, what state
> is the object in?  Will the spec define that state?
>
> jjb
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20121212/18bd3059/attachment-0001.html>


More information about the es-discuss mailing list