ECMAScript 5.1 和 6 规范类型值
ECMAScript 5.1 and 6 Specification Type values
我正在阅读 ECMAScript 5.1 Specification 但我被下面的句子卡住了:
Specification type values are specification artefacts that do not necessarily correspond to any specific entity within an ECMAScript implementation.
如果它们不一定对应于任何特定的实体,那么它们对应的是什么?我的意思是一个规范类型值属于规范类型值的集合(很明显),那这句话想表达什么?
ECMAScript 规范从脚本在一致环境中执行的角度描述了语言应该如何表现。它没有描述应该如何实施该环境,只是描述了其中的脚本 运行 在给定一组输入的情况下应该如何工作。
这句话的第一部分对这里的上下文很重要:
A specification type corresponds to meta-values that are used within algorithms to describe the semantics of ECMAScript language constructs and ECMAScript language types. The specification types are Reference, List, Completion, Property Descriptor, Property Identifier, Lexical Environment, and Environment Record.
因此您发布的引用中的 "specification type":
Specification type values are specification artefacts that do not necessarily correspond to any specific entity within an ECMAScript implementation.
是其中一种类型,例如 "Reference" 或 "Property Identifier"。
这试图传达的要点是,您的实施可以随心所欲地自由实施这些概念。不要求您的实现具有表示 "Reference" 类型的某些对象,或表示 "Completion" 或任何其他类型的对象。只要从脚本 运行 的角度来看,您的实现看起来是正确的,您就可以随心所欲地实现该语言。
我正在阅读 ECMAScript 5.1 Specification 但我被下面的句子卡住了:
Specification type values are specification artefacts that do not necessarily correspond to any specific entity within an ECMAScript implementation.
如果它们不一定对应于任何特定的实体,那么它们对应的是什么?我的意思是一个规范类型值属于规范类型值的集合(很明显),那这句话想表达什么?
ECMAScript 规范从脚本在一致环境中执行的角度描述了语言应该如何表现。它没有描述应该如何实施该环境,只是描述了其中的脚本 运行 在给定一组输入的情况下应该如何工作。
这句话的第一部分对这里的上下文很重要:
A specification type corresponds to meta-values that are used within algorithms to describe the semantics of ECMAScript language constructs and ECMAScript language types. The specification types are Reference, List, Completion, Property Descriptor, Property Identifier, Lexical Environment, and Environment Record.
因此您发布的引用中的 "specification type":
Specification type values are specification artefacts that do not necessarily correspond to any specific entity within an ECMAScript implementation.
是其中一种类型,例如 "Reference" 或 "Property Identifier"。
这试图传达的要点是,您的实施可以随心所欲地自由实施这些概念。不要求您的实现具有表示 "Reference" 类型的某些对象,或表示 "Completion" 或任何其他类型的对象。只要从脚本 运行 的角度来看,您的实现看起来是正确的,您就可以随心所欲地实现该语言。