File tree 1 file changed +11
-6
lines changed
1 file changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -1851,21 +1851,26 @@ When this builtin is invoked with parameter |v|, the following steps must be run
1851
1851
1852
1852
The |funcType| of this builtin is `(func (param (ref null (array (mut i16))) i32 i32) (result externref))`.
1853
1853
1854
+ Note: This function only takes a mutable i16 array defined in its own recursion group.
1855
+ If this is an issue for toolchains, we can look into how to relax the function type
1856
+ while still maintaining good performance.
1857
+
1854
1858
<div algorithm="js-string-fromCharCodeArray">
1855
1859
When this builtin is invoked with parameters |array|, |start|, and |end|, the following steps must be run:
1856
1860
1857
- 1. If |array| is nul]
1861
+ 1. If |array| is null
1858
1862
1. Throw a {{RuntimeError}} exception. TODO: this needs to not be catchable, like a trap.
1859
- 1. If |start| > |end| or |end| > [=array_len=] (|array|)
1863
+ 1. Let |length| be the number of elements in |array|.
1864
+ 1. If |start| > |end| or |end| > |length|
1860
1865
1. Throw a {{RuntimeError}} exception. TODO: this needs to not be catchable, like a trap.
1861
- 1. Let |result| be the empty string
1862
- 1. Let |i| be |start|
1866
+ 1. Let |result| be the empty string.
1867
+ 1. Let |i| be |start|.
1863
1868
1. While |i| < |end|:
1864
- 1. Let |charCode| be [=array_i16_get=] (|array|, |i|) .
1869
+ 1. Let |charCode| be the value of the element stored at index |i| in |array| .
1865
1870
1. Let |charCodeString| be [$FromCharCode$] (|charCode|).
1866
1871
1. Let |result| be the concatenation of |result| and |charCodeString|.
1867
1872
1. Set |i| to |i| + 1.
1868
- 1. Return |result|
1873
+ 1. Return |result|.
1869
1874
1870
1875
</div>
1871
1876
You can’t perform that action at this time.
0 commit comments