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
Fixes #3929 Allow exporting functions named "default". #3930
base: main
Are you sure you want to change the base?
Fixes #3929 Allow exporting functions named "default". #3930
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing a changelog entry.
I believe that this should be safe to add. @Liamolucko would you mind double-checking me on this?
This doesn't work with I don't particularly like adding target-compatibility caveats like this, but I also can't really imagine a scenario where it's an issue - discovering that you aren't allowed to set the default export on If we do go ahead with this it'd be nice if the CLI printed a proper error when trying to create a default export on the web target, rather than delaying it until the JS is actually used and throws a 'duplicate default export' error. |
I think that sounds reasonable enough. I'll try to extend my PR with a check for |
I've added a check that throws an error if wasm-bindgen-cli is called with --target web and there exist a exported symbol called "default". I'm notoriously bad at creating good error messages, so feedback is welcome 😆 |
@daxpedda @Liamolucko Not to be pushy, but is there a chance I can get a new review ? |
This PR fixes #3929.
This PR adds the keyword
default
to the argumentskip_keywords
forfn function_from_decl
when exporting functions.