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 added 3 commits April 22, 2025 19:01
@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. 🎉

lynn and others added 2 commits April 23, 2025 11:45
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.

lynn and others added 3 commits August 12, 2025 12:50
@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)

module_export_types(module, |name, ty| {
writeln!(exports, " readonly {name}: {ty};").unwrap();
if name.contains(':') {
writeln!(exports, " readonly {name:?}: {ty};").unwrap();
Copy link
Member

Choose a reason for hiding this comment

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

Its not entirely clear on first glance whats going on here. I think a comment would help.

Comment on lines +21 to +24
#[wasm_bindgen_test]
fn example_test() {
assert_eq!(example_128(1), None)
}
Copy link
Member

Choose a reason for hiding this comment

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

I assume this is leftover from when you were debugging?

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")
3 participants