Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove Box from the proposal #277

Merged
merged 8 commits into from
Dec 17, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 4 additions & 61 deletions spec/abstract-operations.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ <h1>Abstract Operations</h1>
<emu-clause id="sec-type-conversion">
<h1>Type Conversion</h1>
<p>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.</p>
<p>The BigInt <ins>, Record, Tuple, and Box</ins> type<ins>s</ins> <del>has</del><ins>have</ins> no implicit conversions in the ECMAScript language; programmers must call BigInt <ins>, Record, Tuple, or Box</ins> explicitly to convert values from other types.</p>
<p>The BigInt <ins>, Record, and Tuple</ins> type<ins>s</ins> <del>has</del><ins>have</ins> no implicit conversions in the ECMAScript language; programmers must call BigInt <ins>, Record, or Tuple</ins> explicitly to convert values from other types.</p>

<emu-clause id="sec-toboolean" type="abstract operation">
<h1>
Expand Down Expand Up @@ -102,14 +102,6 @@ <h1>
<ins>Return *true*.</ins>
</td>
</tr>
<tr>
<td>
<ins>Box</ins>
</td>
<td>
<ins>Return *true*.</ins>
</td>
</tr>
<tr>
<td>
Object
Expand Down Expand Up @@ -217,14 +209,6 @@ <h1>
<ins>Throw a *TypeError* exception.</ins>
</td>
</tr>
<tr>
<td>
<ins>Box</ins>
</td>
<td>
<ins>Throw a *TypeError* exception.</ins>
</td>
</tr>
<tr>
<td>
Object
Expand Down Expand Up @@ -344,14 +328,6 @@ <h1>
<ins>Throw a *TypeError* exception.</ins>
</td>
</tr>
<tr>
<td>
<ins>Box</ins>
</td>
<td>
<ins>Throw a *TypeError* exception.</ins>
</td>
</tr>
</tbody>
</table>
</emu-table>
Expand Down Expand Up @@ -451,14 +427,6 @@ <h1>
<ins>Return ? TupleToString(_argument_).</ins>
</td>
</tr>
<tr>
<td>
<ins>Box</ins>
</td>
<td>
<ins>Return ? BoxToString(_argument_).</ins>
</td>
</tr>
<tr>
<td>
Object
Expand Down Expand Up @@ -522,13 +490,6 @@ <h1>
</td>
</tr>
<tr>
<td>
<ins>Box</ins>
</td>
<td>
<ins>Return a new Box object whose [[BoxData]] internal slot is set to _argument_. See <emu-xref href="#sec-box-objects"></emu-xref> for a description of Box objects.</ins>
</td>
</tr>
<tr>
<td>
Number
Expand Down Expand Up @@ -577,14 +538,6 @@ <h1>
<ins>Return a new Tuple object whose [[TupleData]] internal slot is set to _argument_. See <emu-xref href="#sec-tuple-objects"></emu-xref> for a description of Tuple objects.</ins>
</td>
</tr>
<tr>
<td>
<ins>Box</ins>
</td>
<td>
<ins>Return a new Box object whose [[BoxData]] internal slot is set to _argument_. See <emu-xref href="#sec-box-objects"></emu-xref> for a description of Box objects.</ins>
</td>
</tr>
<tr>
<td>
Object
Expand Down Expand Up @@ -695,14 +648,6 @@ <h1>
<ins>Return _argument_.</ins>
</td>
</tr>
<tr>
<td>
<ins>Box</ins>
</td>
<td>
<ins>Return _argument_.</ins>
</td>
</tr>
<tr>
<td>
Object
Expand Down Expand Up @@ -732,7 +677,6 @@ <h1>
1. If Type(_x_) is Number or BigInt, then return ! Type(_x_)::sameValue(_x_, _y_).
1. <ins>If Type(_x_) is Record, then return ! RecordSameValue(_x_, _y_).</ins>
1. <ins>If Type(_x_) is Tuple, then return ! TupleSameValue(_x_, _y_).</ins>
1. <ins>If Type(_x_) is Box, then return ! BoxSameValue(_x_, _y_).</ins>
1. <del>Return ! SameValueNonNumeric(_x_, _y_).</del>
1. <ins>Return ! SameValueNonGeneric(_x_, _y_).</ins>
</emu-alg>
Expand All @@ -757,7 +701,6 @@ <h1>
1. If Type(_x_) is Number or BigInt, then return ! Type(_x_)::sameValueZero(_x_, _y_).
1. <ins>If Type(_x_) is Record, then return ! RecordSameValueZero(_x_, _y_).</ins>
1. <ins>If Type(_x_) is Tuple, then return ! TupleSameValueZero(_x_, _y_).</ins>
1. <ins>If Type(_x_) is Box, then return ! BoxSameValueZero(_x_, _y_).</ins>
1. <del>Return ! SameValueNonNumeric(_x_, _y_).</del>
1. <ins>Return ! SameValueNonGeneric(_x_, _y_).</ins>
</emu-alg>
Expand Down Expand Up @@ -818,8 +761,8 @@ <h1>
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<ins>, Record, Tuple, Box</ins>, 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<ins>, Record, Tuple, Box</ins>, or Symbol, return IsLooselyEqual(? ToPrimitive(_x_), _y_).
1. If Type(_x_) is either String, Number, BigInt<ins>, Record, Tuple</ins>, 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<ins>, Record, Tuple</ins>, 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*, *+&infin;*<sub>𝔽</sub>, or *-&infin;*<sub>𝔽</sub>, return *false*.
1. If ℝ(_x_) = ℝ(_y_), return *true*; otherwise return *false*.
Expand All @@ -842,7 +785,7 @@ <h1>
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. <ins>If Type(_x_) is Record, Tuple or Box, then</ins>
1. <ins>If Type(_x_) is Record or Tuple, then</ins>
1. <ins>Return ! Type(_x_)::sameValueZero(_x_, _y_).</ins>
1. <del>Return ! SameValueNonNumeric(_x_, _y_).</del>
1. <ins>Return ! SameValueNonGeneric(_x_, _y_).</ins>
Expand Down
49 changes: 0 additions & 49 deletions spec/data-types-and-values.html
Original file line number Diff line number Diff line change
Expand Up @@ -156,54 +156,5 @@ <h1>
</emu-alg>
</emu-clause>
</emu-clause>

<emu-clause id="sec-ecmascript-language-types-box-type">
<h1>The Box Type</h1>
<p>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.</p>


<emu-clause id="sec-ecmascript-language-types-box-tostring" type="abstract operation">
<h1>
BoxToString (
_argument_: a Box,
)
</h1>
<dl class="header"></dl>
<emu-alg>
1. Let _valueString_ be ? ToString(_argument_.[[Value]]).
1. Return the string-concatenation of *"Box("*, _valueString_, and *")"*.
</emu-alg>
</emu-clause>

<emu-clause id="sec-ecmascript-language-types-box-samevalue" type="abstract operation">
<h1>
BoxSameValue (
_x_: a Box,
_y_: a Box,
)
</h1>
<dl class="header"></dl>
<emu-alg>
1. Let _xValue_ be _x_.[[Value]].
1. Let _yValue_ be _y_.[[Value]].
1. Return ! SameValue(_xValue_, _yValue_.)
</emu-alg>
</emu-clause>

<emu-clause id="sec-ecmascript-language-types-box-samevaluezero" type="abstract operation">
<h1>
BoxSameValueZero (
_x_: a Box,
_y_: a Box,
)
</h1>
<dl class="header"></dl>
<emu-alg>
1. Let _xValue_ be _x_.[[Value]].
1. Let _yValue_ be _y_.[[Value]].
1. Return ! SameValueZero(_xValue_, _yValue_.)
</emu-alg>
</emu-clause>
</emu-clause>
</emu-clause>
</emu-clause>
8 changes: 0 additions & 8 deletions spec/expression.html
Original file line number Diff line number Diff line change
Expand Up @@ -295,14 +295,6 @@ <h1>Runtime Semantics: Evaluation</h1>
<ins>*"tuple"*</ins>
</td>
</tr>
<tr>
<td>
<ins>Box</ins>
</td>
<td>
<ins>*"box"*</ins>
</td>
</tr>
<tr>
<td>
Object (does not implement [[Call]])
Expand Down
1 change: 0 additions & 1 deletion spec/fundamental-objects.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ <h1>Object.prototype.toString ( )</h1>
1. Else if _O_ has a [[RegExpMatcher]] internal slot, let _builtinTag_ be *"RegExp"*.
1. <ins>Else if _O_ has a [[RecordData]] internal slot, let _builtinTag_ be *"Record"*.</ins>
1. <ins>Else if _O_ has a [[TupleData]] internal slot, let _builtinTag_ be *"Tuple"*.</ins>
1. <ins>Else if _O_ has a [[BoxData]] internal slot, let _builtinTag_ be *"Box"*.</ins>
1. Else, let _builtinTag_ be *"Object"*.
1. Let _tag_ be ? Get(_O_, @@toStringTag).
1. If Type(_tag_) is not String, set _tag_ to _builtinTag_.
Expand Down
105 changes: 0 additions & 105 deletions spec/immutable-data-structures.html
Original file line number Diff line number Diff line change
Expand Up @@ -553,109 +553,4 @@ <h1>Tuple.prototype.withAt ( _index_, _value_ )</h1>
</emu-clause>
</emu-clause>
</emu-clause>

<emu-clause id="sec-box-objects">
<h1>Box Objects</h1>
<emu-clause id="sec-box-constructor">
<h1>The Box Constructor</h1>
<p>The Box constructor:</p>
<ul>
<li>is the intrinsic object <dfn>%Box%</dfn>.</li>
<li>is the initial value of the *"Box"* property of the global object.</li>
<li>creates and initializes a new Box value when called as a function.</li>
<li>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.</li>
</ul>
<emu-clause id="sec-box-constructor-box-value">
<h1>Box ( _arg_ )</h1>
<p>When the `Box` function is called, the following steps are taken:</p>
<emu-alg>
1. If NewTarget is not *undefined*, throw a *TypeError* exception.
1. Return a new Box value whose [[Value]] is _arg_.
</emu-alg>
</emu-clause>
</emu-clause>

<emu-clause id="sec-properties-of-the-box-constructor">
<h1>Properties of the Box Constructor</h1>
<p>The Box constructor:</p>
<ul>
<li>has a [[Prototype]] internal slot whose value is %Function.prototype%.</li>
<li>has the following properties:</li>
</ul>

<emu-clause id="sec-box.containsboxes">
<h1>Box.containsBoxes ( _arg_ )</h1>
<p>The *containsBoxes* function takes one argument _arg_, and performs the following steps:</p>
<emu-alg>
1. If Type(_arg_) is not Record, Tuple or Box, throw a *TypeError* exception.
1. Return ! RecursiveContainsBoxes(_arg_).
</emu-alg>

<emu-clause id="sec-recursivecontainsboxes" aoid="RecursiveContainsBoxes">
<h1>RecursiveContainsBoxes ( _value_ )</h1>
<p>The abstract operation RecursiveContainsBoxes takes the argument _value_. It performs the following steps when called:</p>
<emu-alg>
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*.
</emu-alg>
</emu-clause>
</emu-clause>

<emu-clause id="sec-box.prototype">
<h1>Box.prototype</h1>
<p>The initial value of *Box.prototype* is %Box.prototype%</p>
<p>This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: false }.</p>
</emu-clause>
</emu-clause>

<emu-clause id="sec-properties-of-the-box-prototype-object">
<h1>Properties of the Box Prototype Object</h1>
<p>The Box prototype object:</p>
<ul>
<li>is an ordinary object.</li>
<li>is not a Box object; it does not have a [[BoxData]] internal slot.</li>
<li>has a [[Prototype]] internal slot whose value is *null*.</li>
</ul>
<p>The abstract operation <dfn id="sec-thisboxvalue" aoid="thisBoxValue">thisBoxValue</dfn> takes argument _value_. It performs the following steps when called:</p>
<emu-alg>
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.
</emu-alg>
<emu-clause id="sec-box.prototype.constructor">
<h1>Box.prototype.constructor</h1>
<p>The initial value of *Box.prototype.constructor* is the intrinsic object %Box%</p>
</emu-clause>
<emu-clause id="sec-box.prototype.valueof">
<h1>Box.prototype.valueOf ( )</h1>
<p>When the `valueOf` function is called, the following steps are taken:</p>
<emu-alg>
1. Return ? thisBoxValue(*this* value).
</emu-alg>
</emu-clause>
<emu-clause id="sec-box.prototype-@@toStringTag">
<h1>Box.prototype [ @@toStringTag ]</h1>
<p>The initial value of *Box.prototype[@@toStringTag]* is the String value *"Box"*.</p>
<p>This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *true* }.</p>
</emu-clause>
<emu-clause id="sec-box.prototype.unbox">
<h1>Box.prototype.unbox ( )</h1>
<p>When the `unbox` function is called, the following steps are taken:</p>
<emu-alg>
1. Let _box_ be ? thisBoxValue(*this* value).
1. Return _box_.[[Value]]
</emu-alg>
</emu-clause>
</emu-clause>
</emu-clause>
</emu-clause>
Loading