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

Nested js_namespaces ignore the parent js_namespace #4324

Open
RunDevelopment opened this issue Dec 5, 2024 · 0 comments
Open

Nested js_namespaces ignore the parent js_namespace #4324

RunDevelopment opened this issue Dec 5, 2024 · 0 comments
Labels
breaking-change Tracking breaking changes for the next major version bump (if ever) bug

Comments

@RunDevelopment
Copy link
Contributor

Describe the Bug

#[wasm_bindgen(js_namespace = ["a"])]
extern "C" {
    #[wasm_bindgen(js_namespace = ["b"])]
    fn my_function();
}

The above import generates the following JS glue code:

function __wbg_myfunction_8c7b624429f78550() {
    b.my_function();
};

Note the function is imported as b.my_function() and that js_namespace = ["a"] is ignored.

Expected Behavior

The parent js_namespace should not be ignored. The most sane behavior would probably be to import the function as a.b.my_function().

@daxpedda daxpedda added the breaking-change Tracking breaking changes for the next major version bump (if ever) label Dec 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking-change Tracking breaking changes for the next major version bump (if ever) bug
Projects
None yet
Development

No branches or pull requests

2 participants