Skip to content

Commit 9b67825

Browse files
author
yibuyisheng
committed
3.2.4
1 parent c3939cb commit 9b67825

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

md/3.2.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,3 +49,10 @@ let {x,y} = computeCoordinates();
4949
ECMAScript 5 的严格模式禁止块级函数声明。规范说在非严格模式下是可以的,但是没有说明其中的具体行为。因此,大量 JavaScript 实现支持它们,但是处理方式不一样。
5050

5151
ECMAScript 6 想在块级作用域中声明的函数就保持在块级范围内。作为 ES5 严格模式的扩展是没问题的,但是破坏了一些非严格模式的代码。因此, ES6 为浏览器提供了 “ web 遗留问题兼容性语义( web legacy compatibility semantics )”,允许在块级范围声明的函数存在于函数作用域中。
52+
53+
### 3.2.4 其它关键字
54+
55+
标识符 `yield``static` 仅在 ES5 严格模式下是保留字。 ECMAScript 6 使用特定上下文语法规则使其在非严格模式下也能正常工作:
56+
57+
* 在非严格模式下, `yield` 仅是一个在生成器中的保留字。
58+
* `static` 目前仅用于类字面量中,隐式就是严格的。

0 commit comments

Comments
 (0)