Skip to content

Commit 98ebc03

Browse files
committed
修改 promise
1 parent d252961 commit 98ebc03

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

JS/JS-ch.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -940,7 +940,7 @@ function MyPromise(fn) {
940940
_this.resolve = function (value) {
941941
if (value instanceof MyPromise) {
942942
// 如果 value 是个 Promise,递归执行
943-
return value.then(resolve, reject)
943+
return value.then(_this.resolve, _this.reject)
944944
}
945945
setTimeout(() => { // 异步执行,保证执行顺序
946946
if (_this.currentState === PENDING) {

0 commit comments

Comments
 (0)