Skip to content

questions (possible bugs) re specification/language identity #3207

Open
@jmdyck

Description

@jmdyck

In 5.2.7 Identity, paragraph 2 says:

From the perspective of this specification, the word “is” is used to compare two values for equality, as in “If bool is true, then ...”, [...]. The specification identity of values determines the result of these comparisons and is axiomatic in this specification.

But paragraph 5 tells us that Booleans are "without specification identity". So how can specification identity determine the result of a comparison of two Booleans?


Also, paragraph 3 says:

From the perspective of the ECMAScript language, language values are compared for equality using the SameValue abstract operation and the abstract operations it transitively calls. The algorithms of these comparison abstract operations determine language identity of ECMAScript language values.

The latter sentence seems wrong to me. First, the phrase "language identity of ECMAScript language values" is odd, given that paragraph 5 tells us that many ECMAScript language values are without language identity.

So perhaps what the sentence in question means is something more like "[these algorithms] determine whether or not specific ECMAScript language values have language identity". But that isn't true either. E.g., if you look at the Note in SameValueNonNumber, it implies that Null/Undefined/BigInt/String/Boolean aren't "compared by identity", but that's far short of determining that they don't have language identity. Worse, that Note indicates that all Symbols can be compared by identity, implying that that they all have identity, which is true of specification identity but not language identity. (But maybe this is a bug in SameValue.)

Probably the sentence's use of "determine" is the problem. Maybe it should be more like "[these algorithms] rely on the concept of language identity [defined in paragraph 5]."

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions