components/jsl/patches/jsl-01-jsl-comment.patch
author Petr Sumbera <petr.sumbera@oracle.com>
Thu, 19 Nov 2015 04:51:49 -0800
changeset 5108 0546c7178c66
parent 1237 d1326ae31ed8
permissions -rw-r--r--
22239597 setenv.sh support in conf/ was left during update to version 8

--- 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,