Browse Source

pastojs: compile with pas2js

mattias 3 years ago
parent
commit
0fb08a7619
1 changed files with 5 additions and 3 deletions
  1. 5 3
      packages/pastojs/src/fppjssrcmap.pp

+ 5 - 3
packages/pastojs/src/fppjssrcmap.pp

@@ -25,7 +25,7 @@ unit FPPJsSrcMap;
 interface
 interface
 
 
 uses
 uses
-  SysUtils, Classes, math,
+  SysUtils, math,
   jswriter, jstree, JSSrcMap, fpjson, Pas2JSUtils;
   jswriter, jstree, JSSrcMap, fpjson, Pas2JSUtils;
 
 
 type
 type
@@ -230,7 +230,9 @@ procedure TPas2JSMapper.SaveJSToStream(WithUTF8BOM: boolean;
   const MapFilename: string; s: TFPJSStream);
   const MapFilename: string; s: TFPJSStream);
 var
 var
   MapSrc: string;
   MapSrc: string;
-  {$ifndef pas2js}
+  {$ifdef pas2js}
+  i: integer;
+  {$ELSE}
   bom: string;
   bom: string;
   {$endif}
   {$endif}
 begin
 begin
@@ -240,7 +242,7 @@ begin
     MapSrc:='';
     MapSrc:='';
   {$ifdef pas2js}
   {$ifdef pas2js}
   if WithUTF8BOM then ;
   if WithUTF8BOM then ;
-  for i:=0 to FBufPos-1 do
+  for i:=0 to BufferLength-1 do
     s.push(Buffer[i]);
     s.push(Buffer[i]);
   if MapSrc<>'' then
   if MapSrc<>'' then
     s.push(MapSrc);
     s.push(MapSrc);