promiseResolve(asyncId)
asyncId<number>
当传递给 Promise 构造函数的 resolve 函数被调用时(无论是直接调用还是通过其他方式解决 promise)会被调用。
🌐 Called when the resolve function passed to the Promise constructor is
invoked (either directly or through other means of resolving a promise).
resolve() 不会执行任何可观察的同步工作。
如果 Promise 是通过采用另一个 Promise 的状态来解析的,那么此时该 Promise 不一定会被兑现或拒绝。
🌐 The Promise is not necessarily fulfilled or rejected at this point if the
Promise was resolved by assuming the state of another Promise.
new Promise((resolve) => resolve(true)).then((a) => {}); 调用以下回调:
🌐 calls the following callbacks:
init for PROMISE with id 5, trigger id: 1
promise resolve 5 # corresponds to resolve(true)
init for PROMISE with id 6, trigger id: 5 # the Promise returned by then()
before 6 # the then() callback is entered
promise resolve 6 # the then() callback resolves the promise by returning
after 6