mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-11 09:26:15 +02:00
pastojs: fixed compile on nodejs
git-svn-id: trunk@40352 -
This commit is contained in:
parent
d9f915964a
commit
ae67021c8c
@ -324,7 +324,7 @@ end;
|
|||||||
procedure TBufferWriter.SetAsString(const AValue: TJSWriterString);
|
procedure TBufferWriter.SetAsString(const AValue: TJSWriterString);
|
||||||
begin
|
begin
|
||||||
{$ifdef pas2js}
|
{$ifdef pas2js}
|
||||||
FBuffer:=TJSArray.new;
|
SetLength(FBuffer,0);
|
||||||
FCapacity:=0;
|
FCapacity:=0;
|
||||||
{$endif}
|
{$endif}
|
||||||
FBufPos:=0;
|
FBufPos:=0;
|
||||||
|
@ -22,9 +22,9 @@ uses
|
|||||||
{$IFDEF Pas2js}
|
{$IFDEF Pas2js}
|
||||||
JS, NodeJSFS,
|
JS, NodeJSFS,
|
||||||
{$ELSE}
|
{$ELSE}
|
||||||
RtlConsts,
|
RtlConsts, process,
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
Classes, SysUtils, contnrs, process,
|
Classes, SysUtils, contnrs,
|
||||||
jstree, jswriter, JSSrcMap,
|
jstree, jswriter, JSSrcMap,
|
||||||
PScanner, PParser, PasTree, PasResolver, PasUseAnalyzer, PasResolveEval,
|
PScanner, PParser, PasTree, PasResolver, PasUseAnalyzer, PasResolveEval,
|
||||||
FPPas2Js, FPPJsSrcMap, Pas2jsFileUtils, Pas2jsLogger,
|
FPPas2Js, FPPJsSrcMap, Pas2jsFileUtils, Pas2jsLogger,
|
||||||
@ -3338,10 +3338,10 @@ var
|
|||||||
aProc, pr: TPasToJsProcessor;
|
aProc, pr: TPasToJsProcessor;
|
||||||
Enable: Boolean;
|
Enable: Boolean;
|
||||||
aPlatform, pl: TPasToJsPlatform;
|
aPlatform, pl: TPasToJsPlatform;
|
||||||
|
PostProc: TStringList;
|
||||||
{$IFDEF HasPas2jsFiler}
|
{$IFDEF HasPas2jsFiler}
|
||||||
Found: Boolean;
|
Found: Boolean;
|
||||||
PF: TPas2JSPrecompileFormat;
|
PF: TPas2JSPrecompileFormat;
|
||||||
PostProc: TStringList;
|
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
begin
|
begin
|
||||||
//writeln('TPas2jsCompiler.ReadParam ',Param,' ',Quick,' ',FromCmdLine);
|
//writeln('TPas2jsCompiler.ReadParam ',Param,' ',Quick,' ',FromCmdLine);
|
||||||
@ -4118,6 +4118,17 @@ end;
|
|||||||
|
|
||||||
function TPas2jsCompiler.CallPostProcessor(const JSFilename: String;
|
function TPas2jsCompiler.CallPostProcessor(const JSFilename: String;
|
||||||
Cmd: TStringList; JS: TJSWriterString): TJSWriterString;
|
Cmd: TStringList; JS: TJSWriterString): TJSWriterString;
|
||||||
|
{$IFDEF pas2js}
|
||||||
|
begin
|
||||||
|
Result:='';
|
||||||
|
if ShowUsedTools then
|
||||||
|
Log.LogMsgIgnoreFilter(nPostProcessorRunX,[QuoteStr(JSFilename)+' | '+CmdListAsStr(Cmd)]);
|
||||||
|
raise EFOpenError.Create('post processing is not yet implemented in platform nodejs');
|
||||||
|
if JSFilename='' then ;
|
||||||
|
if Cmd=nil then ;
|
||||||
|
if JS='' then ;
|
||||||
|
end;
|
||||||
|
{$ELSE}
|
||||||
const
|
const
|
||||||
BufSize = 65536;
|
BufSize = 65536;
|
||||||
var
|
var
|
||||||
@ -4240,6 +4251,7 @@ begin
|
|||||||
if ShowUsedTools then
|
if ShowUsedTools then
|
||||||
Log.LogMsgIgnoreFilter(nPostProcessorFinished,[]);
|
Log.LogMsgIgnoreFilter(nPostProcessorFinished,[]);
|
||||||
end;
|
end;
|
||||||
|
{$ENDIF}
|
||||||
|
|
||||||
constructor TPas2jsCompiler.Create;
|
constructor TPas2jsCompiler.Create;
|
||||||
begin
|
begin
|
||||||
|
@ -152,6 +152,16 @@ begin
|
|||||||
Result:=true;
|
Result:=true;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function FileIsExecutable(const AFilename: string): boolean;
|
||||||
|
begin
|
||||||
|
try
|
||||||
|
NJS_FS.accessSync(AFilename,X_OK);
|
||||||
|
except
|
||||||
|
exit(false);
|
||||||
|
end;
|
||||||
|
Result:=true;
|
||||||
|
end;
|
||||||
|
|
||||||
function GetEnvironmentVariableCountPJ: Integer;
|
function GetEnvironmentVariableCountPJ: Integer;
|
||||||
begin
|
begin
|
||||||
Result:=GetEnvironmentVariableCount;
|
Result:=GetEnvironmentVariableCount;
|
||||||
|
Loading…
Reference in New Issue
Block a user