Skip to content

Commit e9ac2ea

Browse files
author
yibuyisheng
committed
3.2.5
1 parent 3c73902 commit e9ac2ea

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

md/3.2.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,4 +59,10 @@ ECMAScript 6 想要块中的函数声明本地化(即该函数的作用域救
5959
* 在松散模式下, `yield` 仅在生成器函数中是保留字。
6060
* `static` 现在仅用于类字面量中,类字面中默认就是严格的(见下文)。
6161

62+
### 3.2.5 隐式的严格模式
63+
64+
在 ECMAScript 6 中,模块体和类体默认就是严格模式的–没必要使用 `use strict` 标记。考虑到我们所有的代码都将会位于模块中, ECMAScript 6 有效地将整个语言升级到了严格模式。
65+
66+
其它结构体(比如箭头函数和生成器函数)本来也应该隐式地为严格模式。但是考虑到通常情况下这些结构都很小,在非严格模式下使用它们就会造成代码中两种模式的碎片化切换。类,尤其是模块一般是足够大的,这样一来就可以忽略碎片化的代码片段问题了。
67+
6268

0 commit comments

Comments
 (0)