11 import { asap } from './asap';
13 export default function then(onFulfillment, onRejection) {
16 const child = new this.constructor(noop);
18 if (child[PROMISE_ID] === undefined) {
22 const { _state } = parent;
25 const callback = arguments[_state - 1];
26 asap(() => invokeCallback(_state, child, callback, parent._result));
28 subscribe(parent, child, onFulfillment, onRejection);