为什么 let 在 for-of 规范中被挑出来?

Why is let singled out in the for-of specification?

for-of 语句的 the specification 部分包含以下行:

It is a Syntax Error if the BoundNames of ForDeclaration contains "let".

在我看来,这意味着你不会写:

for (var let of someObject) { /* ... */ }

但是你也会得到其他保留字的语法错误,例如:

for (var function of someObject) { /* ... */ }

for (let for of someObject) { /* ... */ }

需要说明的是,let 本身就是 用来 在这里声明 变量。 let 有什么特别之处,这意味着它在此处的规范中被挑出来了,还是我对这一行的解释不正确?

那是因为 let 正式不是 keyword:

In strict mode code, let and static are treated as reserved keywords through static semantic restrictions (see 12.1.1, 13.3.1.1, 13.7.5.1, and 14.5.1) rather than the lexical grammar.

我不能告诉你为什么他们决定这样做。