Browse Source

pastojs: check invalid -Jc value

git-svn-id: trunk@38481 -
Mattias Gaertner 7 years ago
parent
commit
7e39a5031d
1 changed files with 11 additions and 1 deletions
  1. 11 1
      packages/pastojs/src/pas2jscompiler.pp

+ 11 - 1
packages/pastojs/src/pas2jscompiler.pp

@@ -2525,7 +2525,17 @@ begin
           c:=p^;
           c:=p^;
           inc(p);
           inc(p);
           case c of
           case c of
-          'c': FileCache.AllJSIntoMainJS:=p^<>'-';
+          'c':
+            begin
+              if p^='-' then
+              begin
+                FileCache.AllJSIntoMainJS:=false;
+                inc(p);
+              end else
+                FileCache.AllJSIntoMainJS:=true;
+              if p^<>#0 then
+                ParamFatal('invalid value "'+String(p)+'"');
+            end;
           'e':
           'e':
             begin
             begin
             Identifier:=NormalizeEncoding(String(p));
             Identifier:=NormalizeEncoding(String(p));