From c1674cab0b55cc02b63f206df385a84978e2764a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Fri, 17 Dec 2021 14:12:14 +0100 Subject: [PATCH 1/8] abstract-operations.html --- spec/abstract-operations.html | 65 +++-------------------------------- 1 file changed, 4 insertions(+), 61 deletions(-) diff --git a/spec/abstract-operations.html b/spec/abstract-operations.html index f1970a6..49270ec 100644 --- a/spec/abstract-operations.html +++ b/spec/abstract-operations.html @@ -7,7 +7,7 @@

Abstract Operations

Type Conversion

The ECMAScript language implicitly performs automatic type conversion as needed. To clarify the semantics of certain constructs it is useful to define a set of conversion abstract operations. The conversion abstract operations are polymorphic; they can accept a value of any ECMAScript language type. But no other specification types are used with these operations.

-

The BigInt , Record, Tuple, and Box types hashave no implicit conversions in the ECMAScript language; programmers must call BigInt , Record, Tuple, or Box explicitly to convert values from other types.

+

The BigInt , Record, and Tuple types hashave no implicit conversions in the ECMAScript language; programmers must call BigInt , Record, or Tuple explicitly to convert values from other types.

@@ -102,14 +102,6 @@

Return *true*. - - - Box - - - Return *true*. - - Object @@ -217,14 +209,6 @@

Throw a *TypeError* exception. - - - Box - - - Throw a *TypeError* exception. - - Object @@ -344,14 +328,6 @@

Throw a *TypeError* exception. - - - Box - - - Throw a *TypeError* exception. - - @@ -451,14 +427,6 @@

Return ? TupleToString(_argument_). - - - Box - - - Return ? BoxToString(_argument_). - - Object @@ -522,13 +490,6 @@

- - Box - - - Return a new Box object whose [[BoxData]] internal slot is set to _argument_. See for a description of Box objects. - - Number @@ -577,14 +538,6 @@

Return a new Tuple object whose [[TupleData]] internal slot is set to _argument_. See for a description of Tuple objects. - - - Box - - - Return a new Box object whose [[BoxData]] internal slot is set to _argument_. See for a description of Box objects. - - Object @@ -695,14 +648,6 @@

Return _argument_. - - - Box - - - Return _argument_. - - Object @@ -732,7 +677,6 @@

1. If Type(_x_) is Number or BigInt, then return ! Type(_x_)::sameValue(_x_, _y_). 1. If Type(_x_) is Record, then return ! RecordSameValue(_x_, _y_). 1. If Type(_x_) is Tuple, then return ! TupleSameValue(_x_, _y_). - 1. If Type(_x_) is Box, then return ! BoxSameValue(_x_, _y_). 1. Return ! SameValueNonNumeric(_x_, _y_). 1. Return ! SameValueNonGeneric(_x_, _y_). @@ -757,7 +701,6 @@

1. If Type(_x_) is Number or BigInt, then return ! Type(_x_)::sameValueZero(_x_, _y_). 1. If Type(_x_) is Record, then return ! RecordSameValueZero(_x_, _y_). 1. If Type(_x_) is Tuple, then return ! TupleSameValueZero(_x_, _y_). - 1. If Type(_x_) is Box, then return ! BoxSameValueZero(_x_, _y_). 1. Return ! SameValueNonNumeric(_x_, _y_). 1. Return ! SameValueNonGeneric(_x_, _y_). @@ -818,8 +761,8 @@

1. If Type(_x_) is String and Type(_y_) is BigInt, return IsLooselyEqual(_y_, _x_). 1. If Type(_x_) is Boolean, return IsLooselyEqual(! ToNumber(_x_), _y_). 1. If Type(_y_) is Boolean, return IsLooselyEqual(_x_, ! ToNumber(_y_)). - 1. If Type(_x_) is either String, Number, BigInt, Record, Tuple, Box, or Symbol and Type(_y_) is Object, return IsLooselyEqual(_x_, ? ToPrimitive(_y_)). - 1. If Type(_x_) is Object and Type(_y_) is either String, Number, BigInt, Record, Tuple, Box, or Symbol, return IsLooselyEqual(? ToPrimitive(_x_), _y_). + 1. If Type(_x_) is either String, Number, BigInt, Record, Tuple, or Symbol and Type(_y_) is Object, return IsLooselyEqual(_x_, ? ToPrimitive(_y_)). + 1. If Type(_x_) is Object and Type(_y_) is either String, Number, BigInt, Record, Tuple, or Symbol, return IsLooselyEqual(? ToPrimitive(_x_), _y_). 1. If Type(_x_) is BigInt and Type(_y_) is Number, or if Type(_x_) is Number and Type(_y_) is BigInt, then 1. If _x_ or _y_ are any of *NaN*, *+∞*𝔽, or *-∞*𝔽, return *false*. 1. If ℝ(_x_) = ℝ(_y_), return *true*; otherwise return *false*. @@ -842,7 +785,7 @@

1. If Type(_x_) is different from Type(_y_), return *false*. 1. If Type(_x_) is Number or BigInt, then 1. Return ! Type(_x_)::equal(_x_, _y_). - 1. If Type(_x_) is Record, Tuple or Box, then + 1. If Type(_x_) is Record or Tuple, then 1. Return ! Type(_x_)::sameValueZero(_x_, _y_). 1. Return ! SameValueNonNumeric(_x_, _y_). 1. Return ! SameValueNonGeneric(_x_, _y_). From 76ab573c458e243e36fa1dc75f5521c08dbbdb4e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Fri, 17 Dec 2021 14:12:41 +0100 Subject: [PATCH 2/8] data-types-and-values --- spec/data-types-and-values.html | 49 --------------------------------- 1 file changed, 49 deletions(-) diff --git a/spec/data-types-and-values.html b/spec/data-types-and-values.html index 5159fc4..2b4dcd6 100644 --- a/spec/data-types-and-values.html +++ b/spec/data-types-and-values.html @@ -156,54 +156,5 @@

- - -

The Box Type

-

The Box type is the set of all the possible singleton primitive wrappers around any ECMAScript value. Each box value holds an associated [[Value]] containing an ECMAScript value. The [[Value]] internal slot is never modified.

- - - -

- BoxToString ( - _argument_: a Box, - ) -

-
- - 1. Let _valueString_ be ? ToString(_argument_.[[Value]]). - 1. Return the string-concatenation of *"Box("*, _valueString_, and *")"*. - -
- - -

- BoxSameValue ( - _x_: a Box, - _y_: a Box, - ) -

-
- - 1. Let _xValue_ be _x_.[[Value]]. - 1. Let _yValue_ be _y_.[[Value]]. - 1. Return ! SameValue(_xValue_, _yValue_.) - -
- - -

- BoxSameValueZero ( - _x_: a Box, - _y_: a Box, - ) -

-
- - 1. Let _xValue_ be _x_.[[Value]]. - 1. Let _yValue_ be _y_.[[Value]]. - 1. Return ! SameValueZero(_xValue_, _yValue_.) - -
-
From 45d4d53b59c37ada0fb7caa9a4992a5ba7dfefab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Fri, 17 Dec 2021 14:12:56 +0100 Subject: [PATCH 3/8] expression --- spec/expression.html | 8 -------- 1 file changed, 8 deletions(-) diff --git a/spec/expression.html b/spec/expression.html index 51948d3..860f348 100644 --- a/spec/expression.html +++ b/spec/expression.html @@ -295,14 +295,6 @@

Runtime Semantics: Evaluation

*"tuple"* - - - Box - - - *"box"* - - Object (does not implement [[Call]]) From 08398e19e45ce5f7c4aecc95dac2e694240008ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Fri, 17 Dec 2021 14:13:11 +0100 Subject: [PATCH 4/8] fundamental-objects --- spec/fundamental-objects.html | 1 - 1 file changed, 1 deletion(-) diff --git a/spec/fundamental-objects.html b/spec/fundamental-objects.html index 5d9be3c..2a29419 100644 --- a/spec/fundamental-objects.html +++ b/spec/fundamental-objects.html @@ -26,7 +26,6 @@

Object.prototype.toString ( )

1. Else if _O_ has a [[RegExpMatcher]] internal slot, let _builtinTag_ be *"RegExp"*. 1. Else if _O_ has a [[RecordData]] internal slot, let _builtinTag_ be *"Record"*. 1. Else if _O_ has a [[TupleData]] internal slot, let _builtinTag_ be *"Tuple"*. - 1. Else if _O_ has a [[BoxData]] internal slot, let _builtinTag_ be *"Box"*. 1. Else, let _builtinTag_ be *"Object"*. 1. Let _tag_ be ? Get(_O_, @@toStringTag). 1. If Type(_tag_) is not String, set _tag_ to _builtinTag_. From d2212a36c761e6d425065e82b90ed38b0e9e25aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Fri, 17 Dec 2021 14:13:33 +0100 Subject: [PATCH 5/8] immutable-data-structures --- spec/immutable-data-structures.html | 105 ---------------------------- 1 file changed, 105 deletions(-) diff --git a/spec/immutable-data-structures.html b/spec/immutable-data-structures.html index bbec3a1..e6c1c1f 100644 --- a/spec/immutable-data-structures.html +++ b/spec/immutable-data-structures.html @@ -553,109 +553,4 @@

Tuple.prototype.withAt ( _index_, _value_ )

- - -

Box Objects

- -

The Box Constructor

-

The Box constructor:

-
    -
  • is the intrinsic object %Box%.
  • -
  • is the initial value of the *"Box"* property of the global object.
  • -
  • creates and initializes a new Box value when called as a function.
  • -
  • is not intended to be used with the `new` operator or to be subclassed. It may be used as the value of an *extends* clause of a class definition but a *super* call to the Box constructor will cause an exception.
  • -
- -

Box ( _arg_ )

-

When the `Box` function is called, the following steps are taken:

- - 1. If NewTarget is not *undefined*, throw a *TypeError* exception. - 1. Return a new Box value whose [[Value]] is _arg_. - -
-
- - -

Properties of the Box Constructor

-

The Box constructor:

-
    -
  • has a [[Prototype]] internal slot whose value is %Function.prototype%.
  • -
  • has the following properties:
  • -
- - -

Box.containsBoxes ( _arg_ )

-

The *containsBoxes* function takes one argument _arg_, and performs the following steps:

- - 1. If Type(_arg_) is not Record, Tuple or Box, throw a *TypeError* exception. - 1. Return ! RecursiveContainsBoxes(_arg_). - - - -

RecursiveContainsBoxes ( _value_ )

-

The abstract operation RecursiveContainsBoxes takes the argument _value_. It performs the following steps when called:

- - 1. Assert: Type(_value_) is not Object. - 1. If Type(_value_) is Box, return *true*. - 1. If Type(_value_) is Record, then - 1. For each _field_ of _value_.[[Fields]], do - 1. If ! RecursiveContainsBoxes(_field_.[[Value]]) is *true*, return *true*. - 1. If Type(_value_) is Tuple, - 1. For each _item_ of _value_.[[Sequence]], do - 1. If ! RecursiveContainsBoxes(_item_) is *true*, return *true*. - 1. Return *false*. - -
-
- - -

Box.prototype

-

The initial value of *Box.prototype* is %Box.prototype%

-

This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: false }.

-
-
- - -

Properties of the Box Prototype Object

-

The Box prototype object:

-
    -
  • is an ordinary object.
  • -
  • is not a Box object; it does not have a [[BoxData]] internal slot.
  • -
  • has a [[Prototype]] internal slot whose value is *null*.
  • -
-

The abstract operation thisBoxValue takes argument _value_. It performs the following steps when called:

- - 1. If Type(_value_) is Box, return _value_. - 1. If Type(_value_) is Object and _value_ has a [[BoxData]] internal slot, then - 1. Let _box_ be _value_.[[BoxValue]]. - 1. Assert: Type(_box_) is Box. - 1. Return _box_. - 1. Throw a *TypeError* exception. - - -

Box.prototype.constructor

-

The initial value of *Box.prototype.constructor* is the intrinsic object %Box%

-
- -

Box.prototype.valueOf ( )

-

When the `valueOf` function is called, the following steps are taken:

- - 1. Return ? thisBoxValue(*this* value). - -
- -

Box.prototype [ @@toStringTag ]

-

The initial value of *Box.prototype[@@toStringTag]* is the String value *"Box"*.

-

This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *true* }.

-
- -

Box.prototype.unbox ( )

-

When the `unbox` function is called, the following steps are taken:

- - 1. Let _box_ be ? thisBoxValue(*this* value). - 1. Return _box_.[[Value]] - -
-
-
From 286f4b4e134a4b7df5c7432dc89d1985a4264028 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Fri, 17 Dec 2021 14:13:59 +0100 Subject: [PATCH 6/8] ordinary-and-exotic-object-behaviours --- ...ordinary-and-exotic-object-behaviours.html | 101 ------------------ 1 file changed, 101 deletions(-) diff --git a/spec/ordinary-and-exotic-object-behaviours.html b/spec/ordinary-and-exotic-object-behaviours.html index 8d92a57..a782245 100644 --- a/spec/ordinary-and-exotic-object-behaviours.html +++ b/spec/ordinary-and-exotic-object-behaviours.html @@ -375,106 +375,5 @@

- - -

Box Exotic Objects

-

A Box object is an exotic object that encapsuates a Box value and exposes virtual integer-indexed data properties corresponding to the individual entries set on the underlying Box value. All keys properties are non-writable and non-configurable.

- -

An object is a Box exotic object (or simply, a Box object) if its following internal methods use the following implementations and it is an Immutable Prototype Exotic Object.

- -

Box exotic objects have the same internal slots as ordinary objects. They also have a [[BoxData]] internal slot.

- - -

[[IsExtensible]] ()

-
-
for
-
a Box exotic object
-
- - 1. Return *false*. - -
- - -

[[GetOwnProperty]] ( _P_ )

-
-
for
-
a Box exotic object
-
- - 1. Return *false*. - -
- - -

[[DefineOwnProperty]] ( _P_, _Desc_ )

-
-
for
-
a Box exotic object
-
- - 1. Return *false*. - -
- - -

[[HasProperty]] ( _P_ )

-
-
for
-
a Box exotic object
-
- - 1. Assert: IsPropertyKey(_P_) is *true*. - 1. Let _parent_ be %Box.prototype%. - 1. Return ? _parent_.[[HasProperty]](_P_). - -
- - -

[[Get]] ( _P_, _Receiver_ )

-
-
for
-
a Box exotic object
-
- - 1. Assert: IsPropertyKey(_P_) is *true*. - 1. Let _parent_ be ? %Box.prototype%. - 1. Return ? _parent_.[[Get]](_P_, _Receiver_). - -
- - -

[[Set]] ( _P_, _Receiver_ )

-
-
for
-
a Box exotic object
-
- - 1. Return *false*. - -
- - -

[[Delete]] ( _P_ )

-
-
for
-
a Box exotic object
-
- - 1. Return *true*. - -
- - -

[[OwnPropertyKeys]] ( )

-
-
for
-
a Box exotic object
-
- - 1. Return a new empty List. - -
-
From 4e8258365779af0d980f83677d18218252d1861d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Fri, 17 Dec 2021 14:15:31 +0100 Subject: [PATCH 7/8] overview --- spec/overview.html | 37 +++---------------------------------- 1 file changed, 3 insertions(+), 34 deletions(-) diff --git a/spec/overview.html b/spec/overview.html index b2e5f6d..5af295a 100644 --- a/spec/overview.html +++ b/spec/overview.html @@ -17,8 +17,8 @@

ECMAScript Overview

primitive values, or functions. A primitive value is a member of one of the following built-in types: Undefined, Null, Boolean, Number, BigInt, String, - and Symbol;, Record, Tuple and Box; an object is a member of the + and Symbol, Record, and Tuple; + an object is a member of the built-in type Object; and a function is a callable object. A function that is associated with an object via a property is called a method. @@ -28,7 +28,7 @@

ECMAScript Overview

out the definition of ECMAScript entities. These built-in objects include the global object; objects that are fundamental to the runtime semantics of the language including `Object`, `Function`, `Boolean`, `Symbol`, - `Record`, `Tuple`, `Box` and various `Error` objects; objects that + `Record`, `Tuple`, and various `Error` objects; objects that represent and manipulate numeric values including `Math`, `Number`, and `Date`; the text processing objects `String` and `RegExp`; objects that are indexed collections of values including `Array` and nine different @@ -111,36 +111,5 @@

Tuple object

- - -

Box value

-

- primitive value which contains an ECMAScript value -

- -

- A box is immutable and it will always contain the same reference over time. However, it does not guarantee that mutable referenced values will not be mutated. -

-
- -

Box type

-

- set of all Box values -

-
- -

Box object

-

- member of the Object type that is an instance of the standard built-in - `Box` constructor -

- -

- A Box object is created by using the `Object` function in a call - expression, supplying an Box value as an argument. The resulting - object has an internal slot whose value is the Box value. -

-
-
From adcd8d99876fc0b12234dbebc03dd531b4f012cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Fri, 17 Dec 2021 14:17:52 +0100 Subject: [PATCH 8/8] structured-data --- spec/structured-data.html | 26 -------------------------- 1 file changed, 26 deletions(-) diff --git a/spec/structured-data.html b/spec/structured-data.html index e586ec8..91fb4d5 100644 --- a/spec/structured-data.html +++ b/spec/structured-data.html @@ -135,23 +135,12 @@

1. Let _value_ be ? Get(_holder_, _key_). - 1. Let _toJSONCalled_ be *false*. 1. If Type(_value_) is Object or BigInt, then 1. Let _toJSON_ be ? GetV(_value_, *"toJSON"*). 1. If IsCallable(_toJSON_) is *true*, then 1. Set _value_ to ? Call(_toJSON_, _value_, « _key_ »). - 1. Set _toJSONCalled_ to *true*. 1. If _state_.[[ReplacerFunction]] is not *undefined*, then 1. Set _value_ to ? Call(_state_.[[ReplacerFunction]], _holder_, « _key_, _value_ »). - 1. Set _value_ to ! MaybeUnwrapBox(_value_). - 1. Else, - 1. Set _value_ to ! MaybeUnwrapBox(_value_). - 1. If _toJSONCalled_ is *false*, then - 1. If Type(_value_) is Object or BigInt, then - 1. Let _toJSON_ be ? GetV(_value_, *"toJSON"*). - 1. If IsCallable(_toJSON_) is *true*, then - 1. Set _value_ to ? Call(_toJSON_, _value_, « _key_ »). - 1. Set _value_ to ! MaybeUnwrapBox(_value_). 1. If Type(_value_) is Object, then 1. If _value_ has a [[NumberData]] internal slot, then 1. Set _value_ to ? ToNumber(_value_). @@ -181,21 +170,6 @@

1. Return *undefined*. - - -

- MaybeUnwrapBox ( - _value_: an ECMAScript language value, - ) -

-
- - 1. If Type(_value_) is Object and _value_ has a [[BoxData]] internal slot, - 1. Set _value_ to _value_.[[BoxData]]. - 1. If Type(_value_) is Box, return ! MaybeUnwrapBox(_value_.[[Value]]). - 1. Return _value_. - -