Skip to content

Conversation

@lynn
Copy link
Contributor

@lynn lynn commented Apr 22, 2025

Fixes #4449.

The change to crates/cli/tests/reference/wasm-export-types.rs reproduces the issue in a test. The change to wasm2es6js.rs fixes it.

@lynn lynn changed the title Comment out test exports in generated .d.ts Quote names containing colons in generated .d.ts Apr 22, 2025
Comment on lines 12 to 76
readonly __wbindgen_export_0: WebAssembly.Table;
readonly "__wbgt__reference_test::example_test": (a: number) => void;
readonly __wbgtest_cov_dump: () => [number, number];
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fix is visible here :) __wbgt__reference_test::example_test is quoted now. 🎉

Copy link
Contributor

@guybedford guybedford left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a changelog entry.

@guybedford
Copy link
Contributor

This still seems to be failing CI unfortunately.

@guybedford
Copy link
Contributor

Finally just looks like the fixtures still just need to be rerun with a bless flag to update the expected output.

@lynn
Copy link
Contributor Author

lynn commented Sep 22, 2025

looks like the fixtures still just need to be rerun with a bless flag to update the expected output.

Sorry, I'm not totally sure what that means or (if it is something I'm supposed to do) how to achieve it. Is there a command I can try running?

@guybedford
Copy link
Contributor

Yes, you can run:

BLESS=1 cargo test -p wasm-bindgen-cli --test reference

Copy link
Member

@daxpedda daxpedda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AFAICT we still need a test for this. Otherwise this is LGTM.

(if you can't get the reference tests to align dw about it, we can fix that before merging)


export interface InitOutput {
readonly memory: WebAssembly.Memory;
readonly "__wbgt__wasm_export_colon_reftest::colon_test": (a: number) => void;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this sufficient test of the feature? Previously, this .d.ts file would have caused a syntax error because there would be no quotes on this line.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great to me.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent! Could you take another look, @daxpedda?

@daxpedda daxpedda merged commit a10a24c into wasm-bindgen:main Nov 4, 2025
53 checks passed
@Spxg
Copy link
Member

Spxg commented Nov 4, 2025

changelog needs an update, it's currently in the release log for version 0.2.104.

@guybedford guybedford mentioned this pull request Nov 28, 2025
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.

wasm_bindgen_test syntax error at :: in .d.ts ("Expected type")

4 participants