-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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(es/minifier): Abort IIFE invoker on eval
#6478
Conversation
@@ -728,6 +728,13 @@ where | |||
} | |||
} | |||
|
|||
// If we has an eval, we cannot remap variables correctly. | |||
let has_eval = contains_eval(body, false); | |||
if !param_ids.is_empty() && has_eval { |
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.
I'm kinda surprised we allow any further modifications in the presence of eval.
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.
eval
is used by some libraries, so I thought we should only give up if it's going to be problematic. (e.g. name mangler aborts)
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.
But I'm not sure about this. Do you think it's better to abort completely on eval
?
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.
Personally, yah, I would. Looking at terser, eval
deopts:
- name mangling
- unused var removal
- joining of expressions
- inlining functions
- conversion from functions/methods to arrows
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.
Did it and checked other passes, too. Thank you!
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.
Automated review comment generated by auto-rebase script
Description:
Related issue:
Investigation
This is an issue of
invoke_iife
. I used patch script to check each function.There are two variables named
exports