Skip to content
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

Add missing variadic bindings for string methods #1491

Merged
merged 1 commit into from
Apr 26, 2019

Conversation

RReverser
Copy link
Member

@RReverser RReverser commented Apr 26, 2019

@RReverser
Copy link
Member Author

127 | #[wasm_bindgen]
    | ^^^^^^^^^^^^^^^ the trait `wasm_bindgen::convert::traits::IntoWasmAbi` is not implemented for `&[wasm_bindgen::JsValue]`

Ah hmm... I should have checked these.

Is there any particular reason these slices are not allowed? (while Box<[JsValue]> is)

@RReverser
Copy link
Member Author

I've added support for [JsValue] slices since it seemed easy to do so (resulting in removing more code than added), but let me know if that's not desired for some reason.

@RReverser
Copy link
Member Author

Oh, hmm, currently bindings assume that they can drop every item of the slice. I see, it's not as easy as seemed initially.

 - `JsString::from_code_point` - allows to create JS strings using slice of codes in WASM memory.
 - `JsString::from_char_code` - same as above, but also uses updated signature with `u16` instead of `u32` (partially helps with rustwasm#1460 at least for the new binding).
@RReverser RReverser changed the title Add more variadic bindings Adds missing variadic bindings for string methods Apr 26, 2019
@RReverser
Copy link
Member Author

Removed the problematic bindings for now, and kept just String::fromCharCode and String::fromCodePoint instead.

@RReverser RReverser changed the title Adds missing variadic bindings for string methods Add missing variadic bindings for string methods Apr 26, 2019
@alexcrichton alexcrichton merged commit 4865b08 into rustwasm:master Apr 26, 2019
@alexcrichton
Copy link
Contributor

👍

@RReverser RReverser deleted the more-variadic branch April 26, 2019 17:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants