You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Terser fails to minify code where a nested template string, with an expression with a comma, is followed by another template string. (This is based on real code generated by Parcel with Emotion css template strings).
Version (complete output of terser -V or specific git commit)
Parse error at 0:1,11
`${`${0,0}`} ${0}`
^
ERROR: Unexpected token: template_substitution ( )
at js_error (/terser/lib/parse.js:385:11)
at croak (/terser/lib/parse.js:1109:9)
at token_error (/terser/lib/parse.js:1117:9)
at unexpected (/terser/lib/parse.js:1123:9)
at expr_atom (/terser/lib/parse.js:2362:9)
at maybe_unary (/terser/lib/parse.js:3147:19)
at expr_ops (/terser/lib/parse.js:3198:24)
at maybe_conditional (/terser/lib/parse.js:3203:20)
at maybe_assign (/terser/lib/parse.js:3280:20)
at expression (/terser/lib/parse.js:3305:24)
Expected result
Successful minification.
The text was updated successfully, but these errors were encountered:
This was caused by the desire to save RAM. token.raw was turned into LATEST_RAW, yet LATEST_RAW is incorrectly reset. Might also be the template string end indicator.
Bug report
Terser fails to minify code where a nested template string, with an expression with a comma, is followed by another template string. (This is based on real code generated by Parcel with Emotion
css
template strings).Version (complete output of
terser -V
or specific git commit)5.14.0
Complete CLI command or
minify()
options usedNote that this is definitely valid JS:
terser
inputterser
output or errorExpected result
Successful minification.
The text was updated successfully, but these errors were encountered: