Reputation: 8030
I'm reading the ECMAScript 5.1 Specification but I'm stuck with the following sentence:
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?
Upvotes: 2
Views: 145
Reputation: 161507
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:
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:
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.
Upvotes: 3