?um/p1-90`语法中允许 yield 和 await 作为
let
await 0;
yield 或 await 之外任意 The syntax-directed operation StringValue takes no arguments and returns a String. It is defined piecewise over the following productions:
求值
在非严格代码中,yield 可以用作标识符。求值 yield 的绑定。
当处理产生式的实例
时,使用以下语法细化
this 关键字关于
false,则返回 true,则返回 数组元素可以在元素列表的开头、中间或结尾被省略。每当元素列表中的逗号前面没有
The syntax-directed operation ArrayAccumulation takes arguments array (an Array) and nextIndex (an
使用
对象初始化器是描述 Object 初始化的表达式,它以类似字面量的形式编写。它是由花括号包围的、零个或多个
在某些上下文中,
除了描述实际对象初始化器之外,
此产生式存在是为了让
The syntax-directed operation IsComputedPropertyKey takes no arguments and returns a Boolean. It is defined piecewise over the following productions:
The syntax-directed operation PropertyDefinitionNodes takes no arguments and returns a
The syntax-directed operation PropertyNameList takes no arguments and returns a
The syntax-directed operation PropertyDefinitionEvaluation takes argument obj (an Object) and returns either a normal completion containing
关于
关于
关于
关于
关于
参见
The abstract operation IsValidRegularExpressionLiteral takes argument literal (a
d、g、i、m、s、u、v 或 y 之外的任何码点,则返回 u,则令 u 为 v,则令 v 为 The syntax-directed operation TemplateStrings takes argument raw (a Boolean) and returns a
The abstract operation TemplateString takes arguments templateToken (a
如果 raw 是
The abstract operation GetTemplateObject takes argument templateLiteral (a
创建模板对象不会导致 abrupt completion。
本规范的未来版本可能会定义模板对象的附加不可枚举属性。
The syntax-directed operation SubstitutionEvaluation takes no arguments and returns either a normal completion containing a
应用于 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 (an ECMAScript language value), expr (an
a[b] = c 的情况下,它要到 c 求值之后才会执行。The abstract operation EvaluatePropertyAccessWithIdentifierKey takes arguments baseValue (an ECMAScript language value), identifierName (an
new 运算符The abstract operation EvaluateNew takes arguments constructExpr (a
执行步骤
The abstract operation EvaluateCall takes arguments func (an ECMAScript language value), thisValueRef (an ECMAScript language value or a
super 关键字super[b] = c 的情况下,它要到 c 求值之后才会执行。The abstract operation GetSuperConstructor takes no arguments and returns an Object or
The abstract operation MakeSuperPropertyReference takes arguments actualThis (an ECMAScript language value), propertyKey (an ECMAScript language value), and strict (a Boolean) and returns a
求值实参列表会产生一个值的
The syntax-directed operation ArgumentListEvaluation takes no arguments and returns either a normal completion containing a
?. 开头。The syntax-directed operation ChainEvaluation takes arguments baseValue (an ECMAScript language value) and baseRef (an ECMAScript language value or a
The abstract operation EvaluateImportCall takes argument specifierExpr (a
The abstract operation ContinueDynamicImport takes arguments promiseCapability (a import()
带标签模板是一种函数调用,其中该调用的实参派生自
The host-defined abstract operation HostGetImportMetaProperties takes argument moduleRecord (a import.meta 返回的对象提供
HostGetImportMetaProperties 的默认实现是返回一个新的空
The host-defined abstract operation HostFinalizeImportMeta takes arguments importMeta (an Object) and moduleRecord (a import.meta 返回的对象。
多数
HostFinalizeImportMeta 的默认实现是返回
在处理产生式
的实例时,
delete 运算符
如果派生的
并且
最后一条规则意味着,像 delete (((foo))) 这样的表达式会因为第一条规则的递归应用而产生
当 delete 运算符出现在严格模式代码中时,如果其 delete 运算符出现在严格模式代码中,且要删除的属性具有 { [[Configurable]]:
void 运算符即使其值未被使用,也必须调用
typeof 运算符+ 运算符一元 + 运算符将其操作数转换为
- 运算符一元 - 运算符将其操作数转换为数值,然后对其取负。对
~)!)* 运算符执行乘法,产生其操作数的乘积。/ 运算符执行除法,产生其操作数的商。% 运算符从隐含的除法中产生其操作数的余数。+)加法运算符执行
-)- 运算符执行减法,产生其操作数的差。
<<)按右操作数指定的数量,对左操作数执行按位左移操作。
>>)按右操作数指定的数量,对左操作数执行符号填充的按位右移操作。
>>>)按右操作数指定的数量,对左操作数执行零填充的按位右移操作。
求值关系运算符的结果始终是
需要 [In] 语法参数,以避免将关系表达式中的 in 运算符与 for 语句中的 in 运算符混淆。
The abstract operation InstanceofOperator takes arguments value (an ECMAScript language value) and target (an ECMAScript language value) and returns either a normal completion containing a Boolean or a throw completion. 它实现用于确定 value 是否为 target 实例的通用算法:要么咨询 target 的
步骤 instanceof 运算符语义。如果对象没有定义或继承 instanceof 语义。
求值相等运算符的结果始终是
相等运算符维持以下不变量:
A != B 等价于 !(A == B)。
A == B 等价于 B == A,但 A 和 B 的求值顺序除外。
相等运算符并不总是具有传递性。例如,可能有两个不同的 String 对象,每个都表示相同的 String 值;每个 String 对象都会被 == 运算符认为等于该 String 值,但这两个 String 对象彼此并不相等。例如:
new String("a") == "a" 和 "a" == new String("a") 都是 new String("a") == new String("a") 是 String 的比较使用对代码单元值序列的简单相等性测试。不会尝试使用 Unicode 规范中定义的更复杂、面向语义的字符或字符串相等性和
&& 或 || 运算符产生的值不一定是
? :)ECMAScript 中
| assignmentOpText | opText |
|---|---|
**= | ** |
*= | * |
/= | / |
%= | % |
+= | + |
-= | - |
<<= | << |
>>= | >> |
>>>= | >>> |
&= | & |
^= | ^ |
|= | | |
The abstract operation ApplyStringOrNumericBinaryOperator takes arguments leftValue (an ECMAScript language value), opText (**, *, /, %, +, -, <<, >>, >>>, &, ^, or |), and rightValue (an ECMAScript language value) and returns either a normal completion containing either a String, a BigInt, or a Number, or a throw completion. It performs the following steps when called:
+,则**,则返回 ? /,则返回 ? %,则返回 ? >>>,则返回 ? | opText | operation |
|---|---|
* | |
+ | |
- | |
<< | |
>> | |
& | |
^ | |
| | |
| opText | operation |
|---|---|
** | |
* | |
/ | |
% | |
+ | |
- | |
<< | |
>> | |
>>> | |
& | |
^ | |
| | |
在步骤
步骤
The abstract operation EvaluateStringOrNumericBinaryExpression takes arguments leftOperand (a **, *, /, %, +, -, <<, >>, >>>, &, ^, or |), and rightOperand (a
在某些情况下,当处理产生式的实例
时,使用以下语法细化
The syntax-directed operation DestructuringAssignmentEvaluation takes argument value (an ECMAScript language value) and returns either a normal completion containing
The syntax-directed operation PropertyDestructuringAssignmentEvaluation takes argument value (an ECMAScript language value) and returns either a normal completion containing a
The syntax-directed operation RestDestructuringAssignmentEvaluation takes arguments value (an ECMAScript language value) and excludedNames (a
The syntax-directed operation IteratorDestructuringAssignmentEvaluation takes argument iteratorRecord (an
通过在访问迭代器或求值
The syntax-directed operation KeyedDestructuringAssignmentEvaluation takes arguments value (an ECMAScript language value) and propertyName (a property key) and returns either a normal completion containing
,)即使其值未被使用,也必须调用