The Javascript plugin's obfuscator does not support Javascript 1.5 regular 
expression syntax
--------------------------------------------------------------------------------------------

                 Key: TRINIDAD-807
                 URL: https://issues.apache.org/jira/browse/TRINIDAD-807
             Project: MyFaces Trinidad
          Issue Type: Bug
          Components: Plugins
    Affects Versions:  1.2.3-plugins
            Reporter: Oded Arbel


I'm trying to run the javascript obfuscator from the maven-plugin-javascript, 
and it breaks when it reaches a regular expression, for example for this 
snippet:

mytext.split(/=/,2) 

the obfuscator breaks and dumps this:

Error processing file:stuff/utils.js to file:blackstuff/utils.js
org.apache.myfaces.trinidadbuild.plugin.javascript.obfuscator.javascript15parser.ParseException:
 Encountered "/=" at line 52, column 42.
Was expecting one of:
    "delete" ...
    "function" ...
    "new" ...
    "this" ...
    "typeof" ...
    "void" ...
    "true" ...
    "false" ...
    "null" ...
    <DECIMAL_LITERAL> ...
    <HEX_LITERAL> ...
    <OCTAL_LITERAL> ...
    <FLOATING_POINT_LITERAL> ...
    <STRING_LITERAL> ...
    <REGULAR_EXPRESSION> ...
    <IDENTIFIER> ...
    "(" ...
    ")" ...
    "{" ...
    "[" ...
    "!" ...
    "~" ...
    "++" ...
    "--" ...
    "+" ...
    "-" ...
    
        at 
org.apache.myfaces.trinidadbuild.plugin.javascript.obfuscator.javascript15parser.JSParser15.generateParseException(JSParser15.java:4389)
        at 
org.apache.myfaces.trinidadbuild.plugin.javascript.obfuscator.javascript15parser.JSParser15.jj_consume_token(JSParser15.java:4263)
        at 
org.apache.myfaces.trinidadbuild.plugin.javascript.obfuscator.javascript15parser.JSParser15.Arguments(JSParser15.java:262)
        at 
org.apache.myfaces.trinidadbuild.plugin.javascript.obfuscator.javascript15parser.JSParser15.PrimarySuffix(JSParser15.java:207)
        at 
org.apache.myfaces.trinidadbuild.plugin.javascript.obfuscator.javascript15parser.JSParser15.PrimaryExpression(JSParser15.java:90)
....

on the face of it it looks like the obfuscator doesn't understand basic regular 
expression syntax as documented here: 
http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Guide:Regular_Expressions


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to