Browse Source

pastojs: fixed compile nodejs

git-svn-id: trunk@43692 -
Mattias Gaertner 5 years ago
parent
commit
822dc85f77
2 changed files with 16 additions and 6 deletions
  1. 4 0
      packages/fcl-passrc/src/pasresolver.pp
  2. 12 6
      packages/pastojs/src/pas2jsresources.pp

+ 4 - 0
packages/fcl-passrc/src/pasresolver.pp

@@ -15677,16 +15677,20 @@ type
               and (NewBaseType in [btByte,btShortInt,btWord,btSmallInt,btIntSingle,btUIntSingle,btLongint])
               and (BaseType1<>btLongWord) and (BaseType2<>btLongWord) then
             NewBaseType:=btLongint
+          {$ifdef HasInt64}
           else if (BaseTypes[btInt64]<>nil)
               and (NewBaseType<=btInt64)
               and (BaseType1<>btQWord) and (BaseType2<>btQWord) then
             NewBaseType:=btInt64
+          {$endif}
           else if (BaseTypes[btIntDouble]<>nil)
               and (NewBaseType<=btIntDouble) then
             NewBaseType:=btIntDouble
+          {$ifdef HasInt64}
           else if (BaseTypes[btQWord]<>nil)
               and not (NewBaseType in btAllSignedInteger) then
             NewBaseType:=btQWord
+          {$endif}
           else
             NewBaseType:=GetCombinedInt(Param1Resolved,Param2Resolved,ErrorPos);
           end

+ 12 - 6
packages/pastojs/src/pas2jsresources.pp

@@ -5,7 +5,13 @@ unit pas2jsresources;
 interface
 
 uses
-  Classes, SysUtils, pas2jsfs, jsTree;
+  Classes, SysUtils,
+  {$IFDEF pas2js}
+  web,
+  {$ELSE}
+  base64,
+  {$ENDIF}
+  pas2jsfs, jsTree;
 
 Type
   TResourceScopeMode = (rmProgram,rmUnit);
@@ -62,10 +68,8 @@ Type
     function GetResourceCount: Integer; override;
     function GetAsString: String; override;
   end;
-implementation
 
-{$IFNDEF PAS2JS}
-uses base64;
+implementation
 
 { TNoResources }
 
@@ -92,8 +96,6 @@ begin
   Result:='';
 end;
 
-{$ENDIF}
-
 { TPas2jsResourceHandler }
 
 
@@ -148,7 +150,11 @@ Var
 
 begin
   F:=LoadFile(aFileName);
+  {$IFDEF pas2js}
+  Result:=window.atob(F.Source);
+  {$ELSE}
   Result:=EncodeStringBase64(F.Source);
+  {$ENDIF}
   // Do not release, FS will release all files
 end;