Uploaded image for project: 'MyFaces Trinidad'
  1. MyFaces Trinidad
  2. TRINIDAD-197

Obfuscation of addition statement where one of the items being added is an increment statement

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 1.0.0-incubating-plugins
    • 1.0.0-incubating-plugins
    • Build
    • 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.

      Attachments

        1. obfuscator.plugin.patch
          9 kB
          Kamran Kashanian
        2. obfuscator.plugin2.patch
          9 kB
          Kamran Kashanian

        Activity

          People

            adamwiner Adam Winer
            mattcooper Matt Cooper
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: