Object.assign and exceptions (was: Object.assign and __proto__ property)

# Erik Arvidsson (12 years ago)

The spec for Object.assign, people.mozilla.org/~jorendorff/es6-draft.html#sec-object.assign, seems to have some issues.

gotAllNames is never read.

What is the intention regarding exceptions? Is the intention to continue assigning properties after an exception is thrown. Why is that the desired behavior?

# André Bargull (12 years ago)

On 10/22/2013 4:00 PM, Erik Arvidsson wrote:

The spec for Object.assign, people.mozilla.org/~jorendorff/es6-draft.html#sec-object.assign, seems to have some issues.

gotAllNames is never read.

It is initialised to false in step 7, read in step 9 and set to true in step 9c. That seems to be ok.

What is the intention regarding exceptions? Is the intention to continue assigning properties after an exception is thrown. Why is that the desired behavior?

I'd guess to align behaviour with Object.mixin, Object.defineProperties, (Object.create), Object.is{Sealed,Frozen} and Object.seal/freeze. This was also covered in the thread starting at esdiscuss/2012-December/027067 .

# Allen Wirfs-Brock (12 years ago)

On Oct 22, 2013, at 7:18 AM, André Bargull wrote:

I'd guess to align behaviour with Object.mixin, Object.defineProperties, (Object.create), Object.is{Sealed,Frozen} and Object.seal/freeze. This was also covered in the thread starting at esdiscuss/2012-December/027067 .

Exactly

# Erik Arvidsson (12 years ago)

Thanks, that makes sense.