From 8586b4ebd1f47bbcbfef09d8547c3c0ef8c07c56 Mon Sep 17 00:00:00 2001 From: Michael Ficarra Date: Fri, 8 Jul 2022 17:55:36 -0600 Subject: [PATCH] fixes #2405: clarify spec values that have identity and its implications --- spec.html | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/spec.html b/spec.html index 8e72a15afc..6648cda74f 100644 --- a/spec.html +++ b/spec.html @@ -1033,6 +1033,13 @@

Mathematical Operations

Value Notation

In this specification, ECMAScript language values are displayed in *bold*. Examples include *null*, *true*, or *"hello"*. These are distinguished from ECMAScript source text such as `Function.prototype.apply` or `let n = 42;`.

+ + +

Identity

+

In this specification, the word “is” is used to compare two values through equality, as in “If _bool_ is *true*, then”. For the purposes of this equality comparison, all values within this specification fall into one of the following two categories.

+

Values without identity are equal to other values without identity if all of their innate characteristics are the same — characteristics such as the magnitude of an integer or the length of a sequence. Because of this, values without identity may be manifest anywhere simply by fully describing their characteristics. It is not meaningful to change the characteristics of a value that does not have identity. Examples of values without identity include, but are not limited to: Booleans; mathematical values and extended mathematical values; Numbers; BigInts; *null*; *undefined*; sequences, including Strings, ECMAScript source text, surrogate pairs, Directive Prologues, etc; UTF-16 code units; Unicode code points; enums; abstract operations, including syntax-directed operations, host hooks, etc; and ordered pairs.

+

In contrast, each value with identity is unique and therefore only equal to itself. Values with identity are like values without identity but with an additional unguessable, unchangeable, universally-unique characteristic called identity. References to existing values with identity cannot be manifest simply by describing them, as the identity itself is indescribable; instead, references to these values must be explicitly passed from one place to another. Some values with identity are mutable and therefore can have their characteristics (except their identity) changed in-place, causing all holders of the value to immediately observe the new characteristics. Examples of values with identity include, but are not limited to: Objects, including function objects, exotic objects, etc; any kind of Records, including Property Descriptors, PrivateElements, etc; symbols; Parse Nodes; Lists; Sets and Relations; Abstract Closures; Data Blocks; Private Names; execution contexts and execution context stacks; agent signifiers; and WaiterLists.

+