Skip to content

Commit 74438d4

Browse files
jlfwongdevongovett
authored andcommitted
Fix methods of LazyPromise (#1059)
1 parent 32c796d commit 74438d4

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

src/builtins/bundle-loader.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,11 @@ function LazyPromise(executor) {
7373
}
7474

7575
LazyPromise.prototype.then = function (onSuccess, onError) {
76-
return this.promise || (this.promise = new Promise(this.executor).then(onSuccess, onError));
76+
if (this.promise === null) this.promise = new Promise(this.executor)
77+
return this.promise.then(onSuccess, onError)
7778
};
7879

7980
LazyPromise.prototype.catch = function (onError) {
80-
return this.promise || (this.promise = new Promise(this.executor).catch(onError));
81+
if (this.promise === null) this.promise = new Promise(this.executor)
82+
return this.promise.catch(onError)
8183
};

0 commit comments

Comments
 (0)