Skip to content

Commit f492a45

Browse files
committed
Fix resolution of wasm_bindgen in js! macro
This fixes an issue that, when a dependent crate depends on `stdweb` for the use of the `js!` macro but does not specify the dependency `wasm_bindgen`, attempting to build for the target `wasm32-unknown-unknown` (or using `wasm-pack` and friends) will yield the following error: error[E0433]: failed to resolve: use of undeclared type or module `wasm_bindgen`
1 parent 9b418d9 commit f492a45

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

stdweb-internal-macros/src/js_shim.rs

+1
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ pub fn js_shim_extern_code( target: Target, code: &str, arg_count: usize, return
115115
let shim_name = &shim_name;
116116
let shim_args = &shim_args;
117117
quote! {
118+
use ::stdweb::private::wasm_bindgen;
118119
use ::stdweb::private::wasm_bindgen::prelude::*;
119120
unsafe fn #shim_name( #(#shim_args),* ) #return_signature {
120121
#[wasm_bindgen(inline_js = #code_string)]

0 commit comments

Comments
 (0)