Browse Source

Changed the map file name to keep all um UTF-8.

Henrique Gottardi Werlang 2 years ago
parent
commit
55ecd471c8
2 changed files with 5 additions and 6 deletions
  1. 4 5
      packages/pastojs/src/fppjssrcmap.pp
  2. 1 1
      packages/pastojs/src/pas2jscompiler.pp

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

@@ -65,7 +65,7 @@ type
   public
     property SrcMap: TPas2JSSrcMap read FSrcMap write SetSrcMap;
     destructor Destroy; override;
-    procedure SaveJSToStream(WithUTF8BOM: boolean; const MapFilename: string; s: TFPJSStream);
+    procedure SaveJSToStream(WithUTF8BOM: boolean; const MapFilename: TJSWriterString; s: TFPJSStream);
     procedure WriteFile(Src, Filename: string);
     // Final destination filename. Usually unit, unless combining javascript in single file.
     property DestFileName : String read FDestFileName Write FDestFileName;
@@ -226,14 +226,13 @@ begin
   inherited Destroy;
 end;
 
-procedure TPas2JSMapper.SaveJSToStream(WithUTF8BOM: boolean;
-  const MapFilename: string; s: TFPJSStream);
+procedure TPas2JSMapper.SaveJSToStream(WithUTF8BOM: boolean; const MapFilename: TJSWriterString; s: TFPJSStream);
 var
-  MapSrc: string;
+  MapSrc: TJSWriterString;
   {$ifdef pas2js}
   i: integer;
   {$ELSE}
-  bom: string;
+  bom: TJSWriterString;
   {$endif}
 begin
   if MapFilename<>'' then

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

@@ -2482,7 +2482,7 @@ begin
     {$ENDIF}
     try
       WithUTF8BOM:=(Log.Encoding='') or (Log.Encoding='utf8');
-      aFileWriter.SaveJSToStream(WithUTF8BOM,ExtractFilename(MapFilename),buf);
+      aFileWriter.SaveJSToStream(WithUTF8BOM, TJSWriterString(ExtractFilename(MapFilename)), buf);
       {$IFDEF Pas2js}
       {$ELSE}
       buf.Position:=0;