Comments in JavaScript be mangled if the comment contain a newline
Closed this issue · 0 comments
ericcornelissen commented
Bug Report
- Package(s): language-js
- Version(s):
v0.1.24
Description
When mangling a JavaScript script with comments, the language-js
plugin might accidentally mangle in comments if the comment contains a newline.
Proof of Concept
-
Have a JavaScript file with mangle-able JS in a multiline comment (/* */). For example:
var foos = document.querySelectorAll(".cls-foo"); /* var bars = document.querySelectorAll(".cls-bar"); */
-
Run WebMangler CLI (version
0.1.6
) with WebMangler Core (version0.1.24
) and the default mangler plugins & default language plugins (at the exact versions found in the WebMangler Corepackage.json
). -
Observe that the comments have been mangled. For the example above:
var foos = document.querySelectorAll(".a"); /* var bars = document.querySelectorAll(".b"); */