ECMAScript 5.1和6规格类型值 [英] ECMAScript 5.1 and 6 Specification Type values

查看:343
本文介绍了ECMAScript 5.1和6规格类型值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在阅读 ECMAScript 5.1规范,但我被卡住了以下句子:

I'm reading the ECMAScript 5.1 Specification but I'm stuck with the following sentence:


规范类型值是不一定对应于ECMAScript实现中的任何特定实体的规范伪像

Specification type values are specification artefacts that do not necessarily correspond to any specific entity within an ECMAScript implementation.

如果它们不一定对应于任何特定的实体,它们对应于什么?我的意思是一个规范类型值属于规范类型值的集合(显然),那么该句子想说什么?

If they do not necessarily correspond to any specific entity, what do they correspond? I mean a specification type value belongs to the set of specification type values (obviously), so what does that sentence want to say?

推荐答案

p> ECMAScript规范描述了语言应该如何从符合环境中执行的脚本的角度来表现。它并没有描述如何实现这个环境,而是运行在其中的脚本是如何工作的一组输入。

The ECMAScript spec describes how the language should behave from the standpoint of a script executing within a conforming environment. It does not describe how that environment should be implemented, just how the script running inside it should work given a set of inputs.

该句的第一部分对于这里的上下文:

The first part of that sentence is important to the context here:


规范类型对应于在算法中用于描述ECMAScript语言结构和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.

所以规范在您发布的报价中键入

So the "specification type" in the quote you posted:


规范类型值是不一定对应于ECMAScript实现中的任何特定实体的规范伪像。

Specification type values are specification artefacts that do not necessarily correspond to any specific entity within an ECMAScript implementation.

是其中一种类型,如参考或属性标识符。

is one of those types, like "Reference" or "Property Identifier".

这个要尝试的一点是,您的实现可以自由地实现这些概念,但是它喜欢。没有要求您的实现具有表示引用类型的某个对象,或表示完成或其他任何其他对象。只要从执行脚本运行的角度来看,事情看起来正确,你可以自由地实现语言。

The point that this is trying to get across is that your implementation is free to implement these concepts however it pleases. There is no requirement that your implementation have some object that represents a "Reference" type, or some object that represents "Completion" or any of the others. As long as, from the standpoint of a script running on your implementation, things look correct, you are free to implement the language however you please.

这篇关于ECMAScript 5.1和6规格类型值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆