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

-sMODULARIZE=instance does not work with closure compiler #23283

Open
sbc100 opened this issue Jan 2, 2025 · 0 comments · May be fixed by #23540
Open

-sMODULARIZE=instance does not work with closure compiler #23283

sbc100 opened this issue Jan 2, 2025 · 0 comments · May be fixed by #23540

Comments

@sbc100
Copy link
Collaborator

sbc100 commented Jan 2, 2025

This is because the module code that defines the __exp_ variables is run through closure compiler but the code that uses this is not.

See #23158

@brendandahl brendandahl linked a pull request Jan 30, 2025 that will close this issue
kleisauke pushed a commit to kleisauke/emscripten that referenced this issue Feb 23, 2025
fafb1a877e851f84c71de6531fe37de2c7700c29
Move modularization code into js compiler

Prior to this change the mudularization was done as a post-processing
step in python.  This complicated things since acorn and closure passes
would only see the inner code and not the whole module.

One concrete benefit is that we can now use `await` in the body of the
factory function since closure no longer sees it as top level (which it
isn't).

Fixes: emscripten-core#23158, emscripten-core#23283
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 a pull request may close this issue.

1 participant