Skip to content

Commit 0b118b1

Browse files
authored
Merge pull request #31 from WebAssembly/exclusive-end
String slice operands have exclusive end
2 parents 98828b4 + fc901e7 commit 0b118b1

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

proposals/stringref/Overview.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -420,8 +420,9 @@ If an isolated surrogate is seen, the behavior determines on the
420420
-> str:stringref
421421
```
422422
Return a substring of *`view`*, for the WTF-8 bytes starting at offset
423-
*`start`* and not greater than *`end`*. *`start`* and *`end`* receive
424-
the "WTF-8 position treatment", as for `stringview_wtf8.advance`.
423+
*`start`* and continuing to but not including *`end`*. *`start`* and
424+
*`end`* receive the "WTF-8 position treatment", as for
425+
`stringview_wtf8.advance`.
425426

426427
### `stringview_wtf16`
427428

@@ -464,8 +465,9 @@ transformation is the "WTF-16 position treatment".
464465
-> str:stringref
465466
```
466467
Return a substring of *`view`*, for the WTF-16 code units starting at offset
467-
*`start`* and not greater than *`end`*. *`start`* and *`end`* receive
468-
the "WTF-16 position treatment", as for `stringview_wtf16.encode`.
468+
*`start`* and continuing to but not including *`end`*. *`start`* and
469+
*`end`* receive the "WTF-16 position treatment", as for
470+
`stringview_wtf16.encode`.
469471

470472
### `stringview_iter`
471473

@@ -641,7 +643,9 @@ rather it just deals in WTF-16, as most source languages that expose
641643
local.get $str
642644
string.as_wtf16
643645
local.get $offset
646+
local.get $offset
644647
local.get $codeunits
648+
i32.add
645649
stringview_wtf16.slice)
646650
```
647651

0 commit comments

Comments
 (0)