details:   /erp/devel/pi/rev/613824a3f1a0
changeset: 12299:613824a3f1a0
user:      Iván Perdomo <ivan.perdomo <at> openbravo.com>
date:      Fri May 20 17:09:50 2011 +0200
summary:   Skip reporting the escape of > character as JS error

diffstat:

 
modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/JSLintChecker.java
 |  18 +++++++++-
 1 files changed, 17 insertions(+), 1 deletions(-)

diffs (40 lines):

diff -r de8e370f92be -r 613824a3f1a0 
modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/JSLintChecker.java
--- 
a/modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/JSLintChecker.java
    Fri May 20 17:06:44 2011 +0200
+++ 
b/modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/JSLintChecker.java
    Fri May 20 17:09:50 2011 +0200
@@ -18,6 +18,7 @@
  */
 package org.openbravo.client.kernel;
 
+import java.util.ArrayList;
 import java.util.List;
 
 import org.openbravo.base.provider.OBProvider;
@@ -56,7 +57,8 @@
     jsLint.addOption(Option.EVIL); // allow eval()
     jsLint.addOption(Option.CONTINUE); // allow continue statement
     final JSLintResult lintResult = jsLint.lint(componentIdentifier, 
javascript);
-    final List<Issue> issues = lintResult.getIssues();
+    final List<Issue> issues = purgeIssuesList(lintResult.getIssues());
+
     if (issues.isEmpty()) {
       return null;
     }
@@ -75,4 +77,18 @@
     }
     return sb.toString();
   }
+
+  private List<Issue> purgeIssuesList(List<Issue> issues) {
+    // FreeMarker escapes '>' to '\>' this doesn't affect the resulting value 
of the
+    // string. Tested: Chrome, IE, Opera, FF
+    // 
https://sourceforge.net/tracker/index.php?func=detail&aid=3303868&group_id=794&atid=100794
+    List<Issue> purgedList = new ArrayList<Issue>();
+    for (Issue issue : issues) {
+      if (issue.getReason().equals("Unexpected '\\'.") && 
issue.getEvidence().contains("\\>")) {
+        continue;
+      }
+      purgedList.add(issue);
+    }
+    return purgedList;
+  }
 }

------------------------------------------------------------------------------
What Every C/C++ and Fortran developer Should Know!
Read this article and learn how Intel has extended the reach of its 
next-generation tools to help Windows* and Linux* C/C++ and Fortran 
developers boost performance applications - including clusters. 
http://p.sf.net/sfu/intel-dev2devmay
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to