Open
Description
Describe the Bug
Take this code:
#[wasm_bindgen(module = "my-great-module")]
extern "C" {
#[wasm_bindgen(js_name = default)]
pub type Module;
#[wasm_bindgen(static_method_of = Module)]
pub fn init();
}
Expected Behavior
Generated index.js:
import { default as default1 } from 'my-great-module';
Actual Behavior
import { Module } from 'my-great-module';
Additional Context
The problem is that static_method_of
binds to the type name given instead of the js_name
defined for that type. static_method_of = default
also doesn't work, because the type default
is not known.
This produces the expected behavior:
#[wasm_bindgen(module = "my-great-module")]
extern "C" {
#[wasm_bindgen(js_name = default)]
pub type Module;
#[wasm_bindgen(static_method_of = Module, js_class = "default")]
pub fn init();
}
but this double specification shouldn't be necessary.