Ecmascript 6 BindingIdentifier和IdentifierReference之间的区别是什么

Ecmascript 6 BindingIdentifier和IdentifierReference之间的区别是什么,ecmascript-6,Ecmascript 6,让我们看看 如你所见: IdentifierReference[Yield, Await]: Identifier [~Yield]yield [~Await]await BindingIdentifier[Yield, Await]: Identifier [~Yield]yield [~Await]await Identifier: IdentifierName but not ReservedWord 标识符绑定和引用都包含相同

让我们看看

如你所见:

IdentifierReference[Yield, Await]:
    Identifier
    [~Yield]yield
    [~Await]await

BindingIdentifier[Yield, Await]:
    Identifier
    [~Yield]yield
    [~Await]await

Identifier:
    IdentifierName but not ReservedWord

标识符绑定和引用都包含相同的内容。这有什么意义?它们有什么不同?

关键是它们出现在不同的上下文中,并且有不同的相关算法

IdentifierReference是表达式中使用的变量名,使用引用进行计算 BindingIdentifier是一个变量名,用于在变量和函数声明、参数、解构、catch子句、for子句等中创建绑定。
在它们的模式中,IdentifierReference可能引用eval或argument,但为它们创建绑定的BindingIdentifier在strict模式下是语法错误。他们共享的唯一算法是。IdentifierReference有一个检查和一个,而BindingIdentifier有一个检查和一个过程。

关键是它们出现在不同的上下文中,并且有不同的相关算法

IdentifierReference是表达式中使用的变量名,使用引用进行计算 BindingIdentifier是一个变量名,用于在变量和函数声明、参数、解构、catch子句、for子句等中创建绑定。 在它们的模式中,IdentifierReference可能引用eval或argument,但为它们创建绑定的BindingIdentifier在strict模式下是语法错误。他们共享的唯一算法是。IdentifierReference具有检查和,而BindingIdentifier具有检查和过程