-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Extend wrapped JS function coverage in core runtime types #12263
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
7bf670a
16caca3
be7ba5e
69c5127
13ac2f3
cbcdb84
3c49212
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -87,14 +87,16 @@ public int hashCode() { | |
| @JS(value = "return String.fromCharCode(...codeUnits);") | ||
Atur256 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| public static native JSString fromCharCode(int... codeUnits); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could use use
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Using int... matches JavaScript’s fromCharCode, which takes numbers, not characters. While char... would work for values ≤ 65535, it forces explicit casting for int values.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In that case, we should have an overload that accepts |
||
|
|
||
| @JS.Coerce | ||
| @JS(value = "return String.fromCharCode(...codeUnits);") | ||
| public static native JSString fromCharCode(char... codeUnits); | ||
|
|
||
|
|
||
| @JS.Coerce | ||
| @JS(value = "return String.fromCodePoint(...codePoints);") | ||
| public static native JSString fromCodePoint(int... codePoints); | ||
|
|
||
| @JS(value = """ | ||
| const sub = Array.from(substitutions); | ||
| console.log(sub); | ||
| return String.raw(template, ...sub);""") | ||
| @JS(value = "return String.raw(template, ...Array.from(substitutions));") | ||
| public static native JSString raw(JSObject template, Object... substitutions); | ||
|
|
||
| @JS.Coerce | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.