-
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
Parameter reassigned before arguments
#5939
Comments
Thanks for the report − investigating. |
So it turns out to be a strict-mode bug/feature of Node.js / V8, i.e. if you add Which web browser were you running the output code on? |
For a quick workaround in your use case, add $ uglifyjs work/test.js --no-module --compress --keep-fnames -b --output work/test.min.js |
This page says the same thing: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Strict_mode
I was using the latest version of Chrome.
The code above is part of WooCommerce 9.3.2. Download the zip file and you will find the code in The file was automatically re-minified with UglifyJS during optimization process on my server and caused the issue. The real command used for the auto-minification process is: uglifyjs "$INPUT_JS" --compress --mangle --keep-fnames --source-map "$SOURCEMAP_CONFIG" --output "$OUTPUT_JS" |
With latest (& greatest?) ES module "strict" mode is supposed to be implicit:
So I guess the reality is that somehow Chrome still runs your code in "sloppy mode", hence the need for |
Uglify version (
uglifyjs -V
)JavaScript input
The
uglifyjs
CLI command executed orminify()
options used.Disable most compress options and enable
merge_vars
,reduce_vars
,unused
, andvarify
.JavaScript output or error produced.
t
is reassigned just before getting its value witharguments
keyword, which results inError: Failed to execute 'replaceState' on 'History': CustomEvent object could not be cloned.
error.The text was updated successfully, but these errors were encountered: