We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 476838e commit 832711dCopy full SHA for 832711d
lib/es6-promise/then.js
@@ -21,11 +21,11 @@ export default function then(onFulfillment, onRejection) {
21
22
const { _state } = parent;
23
24
- if (_state) {
25
- const callback = arguments[_state - 1];
26
- asap(() => invokeCallback(_state, child, callback, parent._result));
27
- } else {
+ if (_state === PENDING) {
28
subscribe(parent, child, onFulfillment, onRejection);
+ } else {
+ const callback = _state === FULFILLED ? onFulfillment : onRejection;
+ asap(() => invokeCallback(_state, child, callback, parent._result));
29
}
30
31
return child;
0 commit comments