-
-
Notifications
You must be signed in to change notification settings - Fork 222
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
Duplicated names in var statements are considered as different variables #685
Comments
RubenVerborgh
added a commit
to linkeddata/rdflib.js
that referenced
this issue
Sep 8, 2017
A bug in the minifier breaks the N3 parser (babel/minify#685).
RubenVerborgh
added a commit
to SolidOS/mashlib
that referenced
this issue
Sep 8, 2017
A bug in the minifier breaks rdflib's N3 parser (babel/minify#685).
This was referenced Sep 8, 2017
dduran1967
pushed a commit
to Yodata/rdflib.js
that referenced
this issue
Dec 9, 2017
A bug in the minifier breaks the N3 parser (babel/minify#685).
boopathi
added a commit
that referenced
this issue
Dec 11, 2017
In one use variable replacement, if the right hand side contains constant violations, the left-hand side is supposed to be preserved, so we detect this and bail out for this case + Fix #685
boopathi
added a commit
that referenced
this issue
Dec 11, 2017
* fix(dce): bail on non-constant replacement path In one use variable replacement, if the right hand side contains constant violations, the left-hand side is supposed to be preserved, so we detect this and bail out for this case + Fix #685 * Fix binding check and checks for not Identifier * Add testcase for non-identifier replacementPaths
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
1. Minimal code to reproduce the bug
Input Code
or
Live example on babeljs.io
Actual Output
Expected Output
Details
Note the incorrect constant propagation in the
console.log
statement: it hasconsole.log(c,c)
, even though the two arguments in the original are different. This happens because the variablea
is declared multiple times asvar
, yet is not recognized as the same variable.In the correct interpretation
a=2
is recognized as a modification to the same variable, so constant propagation is not allowed to happen. Changing the secondvar a
to simplya
makes the problem disappear.Slightly more complex example:
2. Stack Trace if there is an Error thrown during minification
None.
3. Configuration - babel-minify configuration or babelrc
Default.
The problem is with the
deadcode
option (babel-plugin-minify-dead-code-elimination
), which is switched on by default.4. Whether you used it with other presets/plugins - like es2015 or env
None.
5. Environment: gulp, rollup, webpack, babel-cli, etc...?
All.
The text was updated successfully, but these errors were encountered: