?
u
m
/
p
1-9
0
`
yield
与 await
在语法中被允许作为
let
await 0;
yield
或 await
,则为语法错误。
The syntax-directed operation
对一个
在非严格代码中,关键字 yield
可以作为标识符使用。对该 yield
的绑定,好像它是一个普通
当处理产生式实例:
时,使用如下语法细化对
this
关键字 (The this
Keyword)关于
false
,返回 true
,返回 数组元素可在列表的开头、中间或结尾省略。若元素列表中的一个逗号未被
The syntax-directed operation UNKNOWN takes UNPARSEABLE ARGUMENTS. It is defined piecewise over the following productions:
使用
对象初始化器是描述对象初始化的表达式,其形式类似字面量。它是零个或多个
在某些上下文中,
除了描述实际对象初始化器,
该产生式存在是为了让
PropertyNameList 返回的列表不包含通过
The syntax-directed operation
The syntax-directed operation
The syntax-directed operation UNKNOWN takes UNPARSEABLE ARGUMENTS. It is defined piecewise over the following productions:
见
见
见
见
见
The abstract operation
d
、g
、i
、m
、s
、u
、v
、y
之外任意码点,或某码点出现多次,返回 u
,设 u 为 v
,设 v 为 The syntax-directed operation UNKNOWN takes UNPARSEABLE ARGUMENTS. It is defined piecewise over the following productions:
The abstract operation UNKNOWN takes UNPARSEABLE ARGUMENTS. It performs the following steps when called:
若 raw 为
The abstract operation GetTemplateObject takes argument templateLiteral (一个 Parse Node) and returns 一个 Array. It performs the following steps when called:
创建模板对象不会导致突然完成。
同一
规范未来版本可能为模板对象定义额外不可
The syntax-directed operation
对 String.prototype.concat
而非 +
运算符。
对 String.prototype.concat
而非 +
运算符。
对 String.prototype.concat
而非 +
运算符。
该算法不对 delete
、typeof
等运算符。
当处理产生式实例:
时,使用下列语法细化对
该产生式存在是为了阻止自动分号插入规则(
a?.b
`c`
使其被解释为两个合法语句。其目的在于与没有可选链的类似代码保持一致:
a.b
`c`
后者是一个合法语句,且自动分号插入不适用。
属性按名称访问,可以使用点号表示法:
也可以使用方括号表示法:
点号表示法可以通过以下句法转换来解释:
其行为与
相同;类似地
其行为与
相同,其中 <identifier-name-string> 为
The abstract operation EvaluatePropertyAccessWithExpressionKey takes arguments baseValue (一个
a[b] = c
的情形下,会延迟到 c
求值之后。The abstract operation EvaluatePropertyAccessWithIdentifierKey takes arguments baseValue (一个
new
运算符 (The new
Operator)The abstract operation EvaluateNew takes arguments constructExpr (一个
执行步骤
The abstract operation EvaluateCall takes arguments func (一个
super
关键字 (The super
Keyword)super[b] = c
的情形下,会延迟到 c
求值后。The abstract operation GetSuperConstructor takes no arguments and returns 一个
The abstract operation MakeSuperPropertyReference takes arguments actualThis (一个
对参数列表的求值会产生一个值的
The syntax-directed operation
?.
记号开始。The syntax-directed operation UNKNOWN takes UNPARSEABLE ARGUMENTS. It is defined piecewise over the following productions:
The abstract operation UNKNOWN takes UNPARSEABLE ARGUMENTS. It performs the following steps when called:
The abstract operation ContinueDynamicImport takes arguments promiseCapability (一个 import()
带标签模板是一个函数调用,其调用参数来源于
The host-defined abstract operation HostGetImportMetaProperties takes argument moduleRecord (一个 import.meta
返回的对象提供
HostGetImportMetaProperties 的默认实现是返回一个新的空列表。
The host-defined abstract operation HostFinalizeImportMeta takes arguments importMeta (一个 Object) and moduleRecord (一个 import.meta
返回的对象暴露给 ECMAScript 代码。
大多数
HostFinalizeImportMeta 的默认实现是返回
delete
运算符 (The delete
Operator)
若派生的
且
最后一条规则意味着诸如 delete (((foo)))
的表达式会因为递归应用首条规则而产生早期错误。
在严格模式代码中出现的 delete
运算符,如果其
void
运算符 (The void
Operator)必须调用
typeof
运算符 (The typeof
Operator)+
运算符 (Unary +
Operator)一元 + 运算符将其操作数转换为
-
运算符 (Unary -
Operator)一元 -
运算符将其操作数先转换为数值再取相反数。对
~
)!
)*
运算符执行乘法,产生其操作数的乘积。/
运算符执行除法,产生其操作数的商。%
运算符产生隐含除法后的余数。+
)加法运算符执行字符串连接或数值加法。
-
)-
运算符执行减法,产生操作数之差。
<<
)对左操作数按右操作数指定的位数执行按位左移。
>>
)对左操作数按右操作数指定的位数执行带符号(符号位填充)按位右移。
>>>
)对左操作数按右操作数指定的位数执行零填充按位右移。
关系运算符求值结果总是 Boolean,表示操作数之间关系是否成立。
[In] 语法参数用于避免把关系表达式中的 in
运算符与 for
语句中的 in
混淆。
The abstract operation InstanceofOperator takes arguments V (an ECMAScript language value) and target (an ECMAScript language value) and returns 返回一个含 Boolean 的
步骤 instanceof
语义的版本。若对象未定义或继承该方法,则使用默认语义。
相等运算符求值结果总是 Boolean,表示两操作数之间命名关系是否成立。
基于上述定义:
`${a}` == `${b}`
强制字符串比较。+a == +b
强制数值比较。!a == !b
强制布尔比较。相等运算符保持以下不变式:
A != B
等价于 !(A == B)
。A == B
等价于 B == A
,除求值顺序外。相等运算符并非总是传递。例如可能存在两个不同的 String 对象,各表示相同的字符串值;它们分别与该字符串字面值 ==
为 ==
为
new String("a") == "a"
与 "a" == new String("a")
均为 new String("a") == new String("a")
为 字符串比较对代码单元序列执行简单相等测试,不使用 Unicode 规范中更复杂的语义性字符/字符串等价与排序定义。故按 Unicode 标准正则等价的字符串值可能测试为不等;此算法假设两者已规范化。
&&
与 ||
运算符产生的值不一定是 Boolean,而总是两个操作数表达式之一的值。
? :
) (Conditional Operator ( ? :
))ECMAScript 中
assignmentOpText | opText |
---|---|
**= | ** |
*= | * |
/= | / |
%= | % |
+= | + |
-= | - |
<<= | << |
>>= | >> |
>>>= | >>> |
&= | & |
^= | ^ |
|= | | |
The abstract operation ApplyStringOrNumericBinaryOperator takes arguments lVal (一个 **
, *
, /
, %
, +
, -
, <<
, >>
, >>>
, &
, ^
, 或 |
), and rVal (一个
+
,则**
,返回 ? /
,返回 ? %
,返回 ? >>>
,返回 ? opText | operation |
---|---|
* | |
+ | |
- | |
<< | |
>> | |
& | |
^ | |
| | |
opText | operation |
---|---|
** | |
* | |
/ | |
% | |
+ | |
- | |
<< | |
>> | |
>>> | |
& | |
^ | |
| | |
步骤
The abstract operation EvaluateStringOrNumericBinaryExpression takes arguments leftOperand (一个 Parse Node), opText (一个 Unicode 码点序列), and rightOperand (一个 Parse Node) and returns 返回一个含 String、BigInt 或 Number 的
在处理产生式实例:
时,对
The syntax-directed operation
The syntax-directed operation
The syntax-directed operation
The syntax-directed operation
通过在访问迭代器或求
The syntax-directed operation
,
)必须调用