-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Description
I am running into an issue when attempting to compress Acorn.js or Esprima.js for browser use:
Both libraries contain regular expressions that are full of escaped UTF8 characters (Look for NonAsciiIdentifierStart in Esprima, for example).
UglifyJS reads these, resolves the escaped characters, and then outputs them to real UTF8 characters.
Loading this compressed library on WebKit then causes an exception:
Invalid regular expression: range out of order in character class
Using UglifyJS1, I could pass --ascii to the compressor, solving this issue, but leading to an increased file-size of the result (about 4kb more, since all non-ascii chars would now be escaped).
In UglifyJS2, when passing -b ascii_only=true, I do not get any compressed output anymore. I believe, since the beautifier is activated, -c is ignored.
But Ideally, I would like an option that would allow me to just preserve these strings in their current form, including all escaping that they contain.
Depending on the JS parser in use, this might be hard to implement though.
What do you suggest?