@@ -1803,15 +1803,15 @@ To <dfn>validate an import for builtins</dfn> with |import|, enabled builtins |b
1803
1803
1804
1804
<h3 id="builtins-js-string">String Builtins</h3>
1805
1805
1806
- String builtins adapt the interface of the String builtin object. The import name for this set is `wasm:js-string`.
1806
+ String builtins adapt the interface of the [= String=] builtin object. The import name for this set is `wasm:js-string`.
1807
1807
1808
1808
<h4 id="builtins-js-string-abstract-ops">Abstract operations</h4>
1809
1809
<div algorithm>
1810
1810
1811
1811
The <dfn abstract-op lt="UnwrapString">UnwrapString(|v|)</dfn> abstract operation, when invoked, performs the following steps:
1812
1812
1813
1813
1. If [=Type=] (|v|) is not [=String=]
1814
- 1. Throw a {{RuntimeError}} exception. TODO: this needs to not be catchable, like a trap.
1814
+ 1. Throw a {{RuntimeError}} exception as if a [= trap=] was executed .
1815
1815
1. Return |v|
1816
1816
1817
1817
</div>
@@ -1868,10 +1868,10 @@ Note: This function only takes a mutable i16 array defined in its own recursion
1868
1868
When this builtin is invoked with parameters |array|, |start|, and |end|, the following steps must be run:
1869
1869
1870
1870
1. If |array| is null
1871
- 1. Throw a {{RuntimeError}} exception. TODO: this needs to not be catchable, like a trap.
1871
+ 1. Throw a {{RuntimeError}} exception as if a [= trap=] was executed .
1872
1872
1. Let |length| be the number of elements in |array|.
1873
1873
1. If |start| > |end| or |end| > |length|
1874
- 1. Throw a {{RuntimeError}} exception. TODO: this needs to not be catchable, like a trap.
1874
+ 1. Throw a {{RuntimeError}} exception as if a [= trap=] was executed .
1875
1875
1. Let |result| be the empty string.
1876
1876
1. Let |i| be |start|.
1877
1877
1. While |i| < |end|:
@@ -1893,12 +1893,12 @@ Note: This function only takes a mutable i16 array defined in its own recursion
1893
1893
When this builtin is invoked with parameters |string|, |array|, and |start|, the following steps must be run:
1894
1894
1895
1895
1. If |array| is null
1896
- 1. Throw a {{RuntimeError}} exception. TODO: this needs to not be catchable, like a trap.
1896
+ 1. Throw a {{RuntimeError}} exception as if a [= trap=] was executed .
1897
1897
1. Let |string| be [=?=] [$UnwrapString$] (|string|).
1898
1898
1. Let |stringLength| be the [=string/length=] of |string|.
1899
1899
1. Let |arrayLength| be the number of elements in |array|.
1900
1900
1. If |start| + |stringLength| > |arrayLength|
1901
- 1. Throw a {{RuntimeError}} exception. TODO: this needs to not be catchable, like a trap.
1901
+ 1. Throw a {{RuntimeError}} exception as if a [= trap=] was executed .
1902
1902
1. Let |i| be 0.
1903
1903
1. While |i| < |stringLength|:
1904
1904
1. Let |charCode| be [$CharCodeAt$] (|string|, |i|).
@@ -1928,7 +1928,7 @@ The |funcType| of this builtin is `(func (param i32) (result externref))`.
1928
1928
When this builtin is invoked with parameter |v|, the following steps must be run:
1929
1929
1930
1930
1. If |v| > 0x10ffff
1931
- 1. Throw a {{RuntimeError}} exception. TODO: this needs to not be catchable, like a trap.
1931
+ 1. Throw a {{RuntimeError}} exception as if a [= trap=] was executed .
1932
1932
1. Return [=!=] [$Call$] ([=String.fromCodePoint=] , undefined, « [=ToJSValue=] (|v|) »).
1933
1933
1934
1934
</div>
@@ -1943,7 +1943,7 @@ When this builtin is invoked with parameters |string| and |index|, the following
1943
1943
1. Let |string| be [=?=] [$UnwrapString$] (|string|).
1944
1944
1. Let |length| be the [=string/length=] of |string|.
1945
1945
1. If |index| >= |length|
1946
- 1. Throw a {{RuntimeError}} exception. TODO: this needs to not be catchable, like a trap.
1946
+ 1. Throw a {{RuntimeError}} exception as if a [= trap=] was executed .
1947
1947
1. Return [$CharCodeAt$] (|string|, |index|).
1948
1948
1949
1949
</div>
@@ -1958,7 +1958,7 @@ When this builtin is invoked with parameters |string| and |index|, the following
1958
1958
1. Let |string| be [=?=] [$UnwrapString$] (|string|).
1959
1959
1. Let |length| be the [=string/length=] of |string|.
1960
1960
1. If |index| >= |length|
1961
- 1. Throw a {{RuntimeError}} exception. TODO: this needs to not be catchable, like a trap.
1961
+ 1. Throw a {{RuntimeError}} exception as if a [= trap=] was executed .
1962
1962
1. Return [=!=] [$Call$] ([=String.prototype.codePointAt=] , |string|, « [=ToJSValue=] (|index|) »).
1963
1963
1964
1964
</div>
@@ -2014,9 +2014,9 @@ Note: Explicitly allow null strings to be compared for equality as that is meani
2014
2014
When this builtin is invoked with parameters |first| and |second|, the following steps must be run:
2015
2015
2016
2016
1. If |first| is not null and [=Type=] (|first|) is not [=String=]
2017
- 1. Throw a {{RuntimeError}} exception. TODO: this needs to not be catchable, like a trap.
2017
+ 1. Throw a {{RuntimeError}} exception as if a [= trap=] was executed .
2018
2018
1. If |second| is not null and [=Type=] (|second|) is not [=String=]
2019
- 1. Throw a {{RuntimeError}} exception. TODO: this needs to not be catchable, like a trap.
2019
+ 1. Throw a {{RuntimeError}} exception as if a [= trap=] was executed .
2020
2020
1. If [=!=] [=IsStrictlyEqual=] (|first|, |second|) is true
2021
2021
1. Return 1.
2022
2022
1. Return 0.
0 commit comments