archives

« Bugzilla Issues Index

#4391 — 19.1.2.1 Object.assign unnecessary step


Step 5.b.ii seems to be unnecessary:

> 19.1.2.1 Object.assign ( target, ...sources )
> [...]
> 5. For each element nextSource of sources, in ascending index order,
> a. If nextSource is undefined or null, let keys be an empty List.
> b. Else,
> i. Let from be ToObject(nextSource).
> ii. ReturnIfAbrupt(from).

ToObject only returns an abrupt completion in three cases: when called with
`null`, when called with `undefined`, or when called with an abrupt completion.
Due to step 5.a, the first two cases will never occur. And because
`Object.assign` is not used by any internal algorithm, the source cannot be a
completion of any kind.

I recognize that even if this issue is valid, this is very late in the
specification process to be making changes. Would it be better to file bugs
like this for the ES7 BugZilla "product"?


fixed in rev38 publication draft


(In reply to mike from comment #0)

>
> I recognize that even if this issue is valid, this is very late in the
> specification process to be making changes. Would it be better to file bugs
> like this for the ES7 BugZilla "product"?

I'm turning the publication copy to the spec. over to Ecma today, so future bugs you find should be filed for ES7


Got it. Congrats!