components/jsl/patches/jsl-01-jsl-comment.patch
author saurabh.vyas@oracle.com
Fri, 17 Jul 2015 17:41:34 -0700
branchs11u2-sru
changeset 4704 fee46b752e18
parent 2647 c72026b4ef46
permissions -rw-r--r--
21241598 Juno upgrade may not correctly update neutron information 21444880 When the evs information is empty neutron data model is not created in backend

--- jsl-0.3.0/src/jsscan.c.orig	Wed Oct 25 20:41:48 2006
+++ jsl-0.3.0/src/jsscan.c	Thu Oct 11 16:45:39 2012
@@ -875,7 +875,7 @@
      * with the syntax for the @...@ control comments and JScript conditional comments. The "jsl:" syntax
      * is preferred for this reason.
      */
-    jschar controlCommentPrefix[4];
+    jschar controlCommentPrefix[5];
     if (PeekChars(ts, 4, controlCommentPrefix) &&
         JS_TOLOWER(controlCommentPrefix[0]) == 'j' &&
         JS_TOLOWER(controlCommentPrefix[1]) == 's' &&
@@ -885,6 +885,16 @@
         SkipChars(ts, 4);
         jslCC->isAtFormat = JS_FALSE;
     }
+    else if (PeekChars(ts, 5, controlCommentPrefix) &&
+        JS_TOLOWER(controlCommentPrefix[0]) == ' ' &&
+        JS_TOLOWER(controlCommentPrefix[1]) == 'j' &&
+        JS_TOLOWER(controlCommentPrefix[2]) == 's' &&
+        JS_TOLOWER(controlCommentPrefix[3]) == 'l' &&
+        JS_TOLOWER(controlCommentPrefix[4]) == ':') {
+        /* pre-spaced jsl format */
+        SkipChars(ts, 5);
+        jslCC->isAtFormat = JS_FALSE;
+    }
     else if (lint->enableLegacyControlComments && MatchChar(ts, '@')) {
         /* legacy format */
         jslCC->isAtFormat = JS_TRUE;
@@ -1561,6 +1571,10 @@
             while ((c = GetChar(ts)) != EOF &&
                 !(c == '*' && MatchChar(ts, '/'))) {
 
+                /* allow for spaces around jsl: declarations */
+                if (c == ' ' && PeekChar(ts) == '*')
+                    continue;
+
                 /* check for nested comments */
                 if (c == '/' && PeekChar(ts) == '*' &&
                     !js_ReportCompileErrorNumber(cx, ts, NULL,