You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
首先感谢这个库让我更多的了解了 Promise 的实现,(๑•̀ㅂ•́)و✧
其次是模仿实现的时候,发现了一个问题:
let thenable = {
then: function(resolve, reject) {
resolve({
then: function(resolve, reject) {
resolve({
then: function(resolve, reject) {
resolve(42)
}
})
}
})
}
};
var promise1 = new Promise((resolve, reject) => {
resolve(thenable)
})
promise1
.then(function(value) {
console.log(value)
})
浏览器原生的 Promise 会打印 42
这个库会打印 thenable 对象
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#1>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/AC2vG0AT1l5fho-V2t7oVqhh5AYJRIc3ks5uMrN6gaJpZM4Vr0oW>
.
首先感谢这个库让我更多的了解了 Promise 的实现,(๑•̀ㅂ•́)و✧
其次是模仿实现的时候,发现了一个问题:
浏览器原生的 Promise 会打印 42
这个库会打印 thenable 对象
The text was updated successfully, but these errors were encountered: