These changes help clarify and improve the specification, but should not affect implementation conformance.
onFulfilled
and onRejected
passed to then
are not functions.These changes help clarify and improve the specification, but should not affect implementation conformance.
These changes impose new requirements on implementations, either to specify a previously-undefined behavior, or to fix something incorrect that the spec allowed in version 1.0.
onFulfilled
and onRejected
must be called as functions, with no this
value.onFulfilled
and onRejected
, to enforce the important invariant that the stack be clear. In particular, the new wording prevents fulfilling or rejecting a promise from ever synchronously calling the handlers.onFulfilled
or onRejected
before the corresponding promise was respectively fulfilled or rejected.then
, or synchronous exceptions that could be thrown during the process, are nailed down.TypeError
.TypeError
.