mirror of
https://github.com/ruanyf/es6tutorial.git
synced 2024-04-21 12:32:22 +00:00
Merge pull request #1008 from jacty/patch-1
优化了 async 函数内部报错会导致 Promise 对象变为`reject`状态的例子
This commit is contained in:
+3
-3
@@ -184,10 +184,10 @@ async function f() {
|
||||
}
|
||||
|
||||
f().then(
|
||||
v => console.log(v),
|
||||
e => console.log(e)
|
||||
v => console.log(‘resolve’,v),
|
||||
e => console.log('reject',e)
|
||||
)
|
||||
// Error: 出错了
|
||||
//reject Error: 出错了
|
||||
```
|
||||
|
||||
### Promise 对象的状态变化
|
||||
|
||||
Reference in New Issue
Block a user