archives

« Bugzilla Issues Index

#3061 — 19.1.2.1 Object.assign does not account for throwing undefined


19.1.2.1 Object.assign ( target, ...source )

In step 5.i pendingException is set to be undefined.
This is then updated in 5.j.iv.1, 5.j.v.2.a, and 5.j.v.3.b.i.
Finally, it is checked in 5.k to see if it is still undefined, and if it is, it is then re-thrown.

However, I think it is possible to throw undefined, which would be lost and not registered under this scheme of checking if pendingException is undefined.

Sorry if I misunderstood something; thanks for your time!


(In reply to Nathan Braswell from comment #0)

In steps 5.j.iv.1, 5.j.v.2.a, and 5.j.v.3.b.i, `pendingException` is updated to a Completion Record (see Section 6.2.2). For instance, if `undefined` is thrown, you don't get a bare `undefined`, but:

Completion{[[type]]: throw, [[value]]: undefined, [[target]]: empty}