Skip to content

Commit 8bd7487

Browse files
committed
stringview_wtf16.encode returns number of written code units
Since the operand is a maximum number of code units to write, it makes sense to return the number of code units actually written, for the same reason as string.encode_wtf16. See #24.
1 parent e5062aa commit 8bd7487

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

proposals/stringref/Overview.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -458,10 +458,12 @@ Return the 16-bit code unit at offset *`pos`* in the WTF-16 encoding of
458458

459459
```
460460
(stringview_wtf16.encode $memory view:stringview_wtf16 ptr:address pos:i32 len:i32)
461+
-> codeunits:i32
461462
```
462463
Write a subsequence of the WTF-16 encoding of *`view`* to memory at
463464
*`ptr`*, starting at the WTF-16 offset *`pos`*, writing no more than
464465
*`len`* 16-bit code units. If *`ptr`* is not two-byte aligned, trap.
466+
Return the number of code units written.
465467

466468
If *`pos`* is greater than the number of WTF-16 code units in *`view`*,
467469
it is as if it were instead given as the code unit length. This

0 commit comments

Comments
 (0)