Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@

#### :boom: Breaking Change

- Fix return type of `String.charCodeAt`. https://github.com/rescript-lang/rescript/pull/7864

#### :eyeglasses: Spec Compliance

#### :rocket: New Feature
Expand Down
2 changes: 1 addition & 1 deletion packages/@rescript/runtime/Stdlib_String.res
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ external compare: (string, string) => Stdlib_Ordering.t = "%compare"
@get_index external getUnsafe: (string, int) => string = ""
@send external charAt: (string, int) => string = "charAt"

@send external charCodeAt: (string, int) => float = "charCodeAt"
@send external charCodeAt: (string, int) => int = "charCodeAt"
@send external codePointAt: (string, int) => option<int> = "codePointAt"

@send external concat: (string, string) => string = "concat"
Expand Down
4 changes: 2 additions & 2 deletions packages/@rescript/runtime/Stdlib_String.resi
Original file line number Diff line number Diff line change
Expand Up @@ -220,12 +220,12 @@ See [`String.charCodeAt`](https://developer.mozilla.org/en-US/docs/Web/JavaScrip
## Examples

```rescript
String.charCodeAt(`😺`, 0) == 0xd83d->Int.toFloat
String.charCodeAt(`😺`, 0) == 0xd83d
String.codePointAt(`😺`, 0) == Some(0x1f63a)
```
*/
@send
external charCodeAt: (string, int) => float = "charCodeAt"
external charCodeAt: (string, int) => int = "charCodeAt"

/**
`codePointAt(str, index)` returns the code point at position `index` within
Expand Down
Loading