1
0
mirror of https://github.com/ruanyf/es6tutorial.git synced 2025-05-24 18:32:22 +00:00

Merge pull request #421 from int64ago/patch-1

Fix typo
This commit is contained in:
Ruan YiFeng 2017-06-06 23:54:21 -05:00 committed by GitHub
commit a64204847b

View File

@ -171,7 +171,7 @@ setTimeout(() => foo = 'baz', 500);
上面代码输出变量`foo`,值为`bar`500毫秒之后变成`baz`
这一点与 CommonJS 规范完全不同。CommonJS 模块输出的是值的缓存,不存在动态更新,详见下文《ES6模块加载的实质》一节。
这一点与 CommonJS 规范完全不同。CommonJS 模块输出的是值的缓存,不存在动态更新,详见下文《Module 的加载实现》一节。
最后,`export`命令可以出现在模块的任何位置,只要处于模块顶层就可以。如果处于块级作用域内,就会报错,下一节的`import`命令也是如此。这是因为处于条件代码块之中就没法做静态优化了违背了ES6模块的设计初衷。