Skip to content

Commit 39ec0d3

Browse files
committed
String.charCodeAt should return int
1 parent 05c10e3 commit 39ec0d3

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

packages/@rescript/runtime/Stdlib_String.res

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ external compare: (string, string) => Stdlib_Ordering.t = "%compare"
1717
@get_index external getUnsafe: (string, int) => string = ""
1818
@send external charAt: (string, int) => string = "charAt"
1919

20-
@send external charCodeAt: (string, int) => float = "charCodeAt"
20+
@send external charCodeAt: (string, int) => int = "charCodeAt"
2121
@send external codePointAt: (string, int) => option<int> = "codePointAt"
2222

2323
@send external concat: (string, string) => string = "concat"

packages/@rescript/runtime/Stdlib_String.resi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,12 +220,12 @@ See [`String.charCodeAt`](https://developer.mozilla.org/en-US/docs/Web/JavaScrip
220220
## Examples
221221
222222
```rescript
223-
String.charCodeAt(`😺`, 0) == 0xd83d->Int.toFloat
223+
String.charCodeAt(`😺`, 0) == 0xd83d
224224
String.codePointAt(`😺`, 0) == Some(0x1f63a)
225225
```
226226
*/
227227
@send
228-
external charCodeAt: (string, int) => float = "charCodeAt"
228+
external charCodeAt: (string, int) => int = "charCodeAt"
229229

230230
/**
231231
`codePointAt(str, index)` returns the code point at position `index` within

0 commit comments

Comments
 (0)