Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
1.0.0-incubating-plugins
-
None
-
maven-javascript-plugin
Description
If you have JavaScript code like the following:
var x = 1;
var y = "" + ++x;
It is a legal operation. However, if this code is run through the maven-javascript-plugin, the second line becomes something like this:
var y=""+++x;
This yields an invalid increment operand. Instead, the space between the "" and the "+" must be preserved. I also suspect (but have not tested) this may be a problem with this code too:
var a = 1;
var b = a++ + "";
I suspect the increment and the decrement tokens in the obfuscater just need to be tagged as space sensitive (both before and after)--so we don't remove the spaces when compacting the code.