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
New bug in v3.4.2+3.4.3 with self-referencing variable function names like those used by d3.js #3211
Comments
@michaeldrotar what options were provided to Practically there is nothing I can do until a reproducible test case can be devised, so this will eventually be closed unless you or somebody else come up with one. |
I just used default uglifier's options see https://github.com/lautis/uglifier |
@ahorek to confirm your belief, try |
no, but |
here's a reproduction repo in ruby
uglifier 4.1.14 (uglifyjs2 3.4.3) - doesn't work (works with {compress:{unused:false}}) I'll try to reproduce it with uglifyjs only, but uglifier is just a ruby wrapper and the only thing that was changed between these versions was uglifyjs2 |
@ahorek thanks for the effort - let me know when you have narrowed with only |
I wasn't able to reproduce it on nodejs, then I upgraded uglifier manually to uglifyjs 3.4.4 and it fixed the problem! #3207 thanks @alexlamsl |
@ahorek thanks for the testing - I can confirm that https://github.com/lautis/uglifier/blob/5a92d5c236c2101bb554f4f012122c5ef8d5487d/lib/uglifier.rb#L99 So it is a little more than just a wrapper 😉 |
Appreciate all the work, sorry I couldn't contribute more during the work day. Thanks! |
An To reproduce the failure:
If the same file is uglified with the same command with the uglify commit prior to ab36b9b, namely 2833091, then the web page works correctly and a chart can be seen. |
@kzc - sry, I can't reproduce your case with uglify-js 3.4.4 but maybe something is still wrong... I use uglifier with uglify-js 3.4.4.
here's a relevant minified snipet, I have an error ReferenceError: assignment to undeclared variable _c
@alexlamsl you've a test case for this, it's wierd... |
My mistake - the instructions in #3211 (comment) only lead to a reproducible failure in Safari 9, and not on latest Chrome and FireFox. @ahorek What specific browser/version are you experiencing the error on? |
Lastest Firefox, but I don't think it's browser's fault. Is your error on Safari simmilar or something different? I'ĺl retest it tomorrow. |
The |
How? Is there a security issue or something? |
Fixing |
It sounds like we should improve the test for |
@eight04 And thanks for the relevant and detailed reports in the past - keep it up 👍 |
Bug report
*Uglify version 3.4.2 + 3.4.3
Apologies in advance cause I'm not really sure how to show a reproducible example, but this worked fine up to and including in v3.4.1.. broke in 3.4.2, still not working in 3.4.3 so I thought I should report it.
Our js stack includes d3.js, which has this code:
In 3.4.1, it compiled to this:
Now it compiles to this:
And produces an error that
Oda
is undefined. Minified names aside, can see it used to compilefunction e(t)
and assigned thate
to.exponent
-- now justfunction(t)
so nothing to assign. No idea where it's gettingOda
from -- I can share more source if helpful butOda
is not referenced anywhere prior but is listed 21 times total (in our whole source, including outside of d3.js), but is never assigned a value nor used as a function name.The text was updated successfully, but these errors were encountered: