File tree Expand file tree Collapse file tree 2 files changed +2
-2
lines changed Expand file tree Collapse file tree 2 files changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -913,7 +913,7 @@ async function* prefixLines(asyncIterable) {
913
913
}
914
914
```
915
915
916
- 异步 Generator 函数的返回值是一个异步 Iterator,即每次调用它的` next ` 方法,会返回一个 Promise 对象,也就是说,跟在` yield ` 命令后面的,应该是一个 Promise 对象。
916
+ 异步 Generator 函数的返回值是一个异步 Iterator,即每次调用它的` next ` 方法,会返回一个 Promise 对象,也就是说,跟在` yield ` 命令后面的,应该是一个 Promise 对象。如果像上面那个例子那样, ` yield ` 命令后面是一个字符串,会被自动包装成一个 Promise 对象。
917
917
918
918
``` javascript
919
919
function fetchRandom () {
Original file line number Diff line number Diff line change @@ -650,7 +650,7 @@ import {db, users} from './index';
650
650
651
651
### 简介
652
652
653
- 前面介绍过,` import ` 命令会被 JavaScript 引擎静态分析,先于模块内的其他语句执行(` import ` 命令叫做”连接“ binding 其实更合适)。所以,下面的代码会报错。
653
+ 前面介绍过,` import ` 命令会被 JavaScript 引擎静态分析,先于模块内的其他语句执行(` import ` 命令叫做“连接” binding 其实更合适)。所以,下面的代码会报错。
654
654
655
655
``` javascript
656
656
// 报错
You can’t perform that action at this time.
0 commit comments