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

Fix bug with reportUndefinedSymbols shim #1919

Merged
merged 1 commit into from
Mar 29, 2024

Conversation

garrettgu10
Copy link
Contributor

Looks like #1868 also replaces a call to Module.reportUndefinedSymbols, which throws an error in local dev because this value is assigned in two other places like so:

Module.reportUndefinedSymbols = () => {}
...
Module["reportUndefinedSymbols"] = ...

Which are not matched by the rule. This PR simply refuses to replace Module.reportUndefinedSymbols() with Module.reportUndefinedSymbolsNoOp().

Copy link
Contributor

@hoodmane hoodmane left a comment

Choose a reason for hiding this comment

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

This change confuses me but the tests pass so I'll approve. Thanks @garrettgu10!

@garrettgu10
Copy link
Contributor Author

@hoodmane

I'm also confused about why emscripten has both reportUndefinedSymbols and Module.reportUndefinedSymbols, maybe it would be smart to get to the bottom of that before merging...

another alternative fix would be to replace "reportUndefinedSymbols" instead of "reportUndefinedSymbols()". I went with this approach because I was concerned about changing the API of Module, but I think that might be more consistent with other substitutions we make. What do you think?

@hoodmane
Copy link
Contributor

both reportUndefinedSymbols and Module.reportUndefinedSymbols

Generally Module.blah is the "public" version of things, so anything that exposed to user code is put there. Possibly the Module.reportUndefinedSymbols stuff comes from Pyodide.

Replacing reportUndefinedSymbols by itself doesn't work because then we also replace the definition and we get a reportUndefinedSymbolsNoOp that is not a no-op.

@garrettgu10 garrettgu10 merged commit c9c3ecd into main Mar 29, 2024
9 of 10 checks passed
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.

2 participants