Skip to content

Commit

Permalink
made checks explicit
Browse files Browse the repository at this point in the history
  • Loading branch information
bekzod committed May 20, 2017
1 parent b37a3d0 commit 67f81c2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/es6-promise/then.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ export default function then(onFulfillment, onRejection) {

const { _state } = parent;

if (_state) {
const callback = arguments[_state - 1];
asap(() => invokeCallback(_state, child, callback, parent._result));
} else {
if (_state === PENDING) {
subscribe(parent, child, onFulfillment, onRejection);
} else {
const callback = _state === FULFILLED ? onFulfillment : onRejection;
asap(() => invokeCallback(_state, child, callback, parent._result));
}

return child;
Expand Down

0 comments on commit 67f81c2

Please sign in to comment.