-
-
Notifications
You must be signed in to change notification settings - Fork 225
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
unnecessary escaping in string concatinaion #440
Comments
I had the same issue, its not actually the backslash being quoted its the single quote, e.g. this is a simpler breaking case: // In code
const s = " ' " + "quote breaks"
// Out code
const s = " \\' quote breaks" |
Hmm I guess after #384 the strings are first run through jsesc by the minify-constant-folding transform, and then again by babel-generator. So backslashes end up being duplicated. Maybe instead of using jsesc, minify-constant-folding should handle |
What would be a correct way to handle these ? /cc @mathiasbynens |
As @goto-bus-stop said: don‘t escape strings twice. The most sensible solution IMHO would be to make babel-generator pass |
Hey,
For some reason I can't explain babili(?) escapes the backslash in the following string:
input:
babili output:
it only happens when i concat strings, it works perfectly when i input:
I use the babili cli without any presets
p.s the babel repl doesn't show the problem (probably browser html escaping)
The text was updated successfully, but these errors were encountered: