-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
Closure only runs on the subset of the generated JS code not, for example, modularized code #23158
Comments
sbc100
changed the title
Closure only run on the subset of the generated JS code not, for example, modularized code
Closure only runs on the subset of the generated JS code not, for example, modularized code
Dec 13, 2024
sbc100
added a commit
to sbc100/emscripten
that referenced
this issue
Dec 30, 2024
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
sbc100
added a commit
to sbc100/emscripten
that referenced
this issue
Dec 31, 2024
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
sbc100
added a commit
to sbc100/emscripten
that referenced
this issue
Dec 31, 2024
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
sbc100
added a commit
to sbc100/emscripten
that referenced
this issue
Jan 2, 2025
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Since we do modularization after we run closure compiler this can lead to some strange effects. For example, if we try to use
await
in the main out closure will see it as a top-level-await, even though in modularize mode its inside the factory function.The text was updated successfully, but these errors were encountered: