1
0
mirror of https://github.com/ruanyf/es6tutorial.git synced 2025-05-29 05:42:20 +00:00

优化了 async 函数内部报错会导致 Promise 对象变为reject状态的例子

原来的例子并不能很明显的表示打印的内容来自于 reject 的回调。
This commit is contained in:
Jacty 2020-09-13 01:11:40 +08:00 committed by GitHub
parent 50b25c1a64
commit c432253193
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -184,10 +184,10 @@ async function f() {
} }
f().then( f().then(
v => console.log(v), v => console.log(resolve,v),
e => console.log(e) e => console.log('reject',e)
) )
// Error: 出错了 //reject Error: 出错了
``` ```
### Promise 对象的状态变化 ### Promise 对象的状态变化