-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Fix Closure await import mangling regression
#27173
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
Changes from 5 commits
dd6b2c8
f0ecb68
1d0ccd2
7eff01a
2283dfc
8fb7c06
66ec26c
de815bf
43012c2
546051e
e466e04
2e08062
d6a77b9
d8c0b9a
f50c1ac
c0d52e1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2126,6 +2126,7 @@ def fix_js_mangling(js_file): | |
| # https://github.com/google/closure-compiler/blob/v20260401/src/com/google/javascript/jscomp/ConvertChunksToESModules.java#L111-L113 | ||
| src = src \ | ||
| .replace('EMSCRIPTEN$AWAIT$IMPORT', 'await import') \ | ||
| .replace('void 0||await import', 'await import') \ | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why do this in two steps like this?
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Without this, it still emits: isPthread=(void 0||await import("node:worker_threads")).workerData==="em-pthread";The reason this is done in two steps is that Closure optimizes away the other
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe wroth a comment here. I'm still a little confused by this.
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added a comment with 8fb7c06. |
||
| .replace('export{};\n', '') | ||
|
|
||
| src = src.replace('EMSCRIPTEN$AWAIT(', 'await (') | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
test_esm_pthread_closure?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is an extend of
test_esm_worker, just liketest_esm_worker_single_file.