From e7f787f78d81f46b1e4c52ff9426e2348e01c174 Mon Sep 17 00:00:00 2001 From: mattias Date: Thu, 12 May 2022 12:34:49 +0200 Subject: [PATCH] pas2js: fixed uninitialized var, serviceworker targetos nodejs --- components/pas2js/pjscontroller.pp | 2 ++ components/pas2js/pjsdsgnregister.pas | 2 +- components/pas2js/pjsprojectoptions.pp | 6 ------ 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/components/pas2js/pjscontroller.pp b/components/pas2js/pjscontroller.pp index d6bf33ff89..28be035a5a 100644 --- a/components/pas2js/pjscontroller.pp +++ b/components/pas2js/pjscontroller.pp @@ -387,6 +387,7 @@ begin if WebDir='' then exit(mrCancel); + SWSLocation:=nil; if Location<>'' then begin Location:=GetProjectLocation(aProject); @@ -414,6 +415,7 @@ begin debugln(['Info: TPJSController.RunProject missing htmlfile']); exit(mrCancel); end; + if SWSLocation<>nil then begin if not SimpleWebServerController.OpenBrowserWithLocation(SWSLocation,HTMLFilename) then diff --git a/components/pas2js/pjsdsgnregister.pas b/components/pas2js/pjsdsgnregister.pas index 33a37c4541..5929a9ef97 100644 --- a/components/pas2js/pjsdsgnregister.pas +++ b/components/pas2js/pjsdsgnregister.pas @@ -840,7 +840,7 @@ begin AProject.AddFile(MainFile,false); AProject.MainFileID:=0; CompOpts:=AProject.LazCompilerOptions; - SetDefaultServiceWorkerCompileOptions(CompOpts); + SetDefaultNodeJSCompileOptions(CompOpts); CompOpts.TargetFilename:=ExtractFileNameOnly(LPRFilename); SetDefaultServiceWorkerRunParams(AProject.RunParameters.GetOrCreate('Default')); AProject.MainFile.SetSourceText(CreateProjectSource,true); diff --git a/components/pas2js/pjsprojectoptions.pp b/components/pas2js/pjsprojectoptions.pp index 127265d789..b6350c47f4 100644 --- a/components/pas2js/pjsprojectoptions.pp +++ b/components/pas2js/pjsprojectoptions.pp @@ -63,7 +63,6 @@ Procedure SetDefaultWebRunParams(RunParams : TAbstractRunParamsOptionsMode); Procedure SetDefaultServiceWorkerRunParams(RunParams : TAbstractRunParamsOptionsMode); Procedure SetDefaultNodeRunParams(RunParams : TAbstractRunParamsOptionsMode); Procedure SetDefaultWebCompileOptions(CompOpts: TLazCompilerOptions); -Procedure SetDefaultServiceWorkerCompileOptions(CompOpts: TLazCompilerOptions); Procedure SetDefaultNodeJSCompileOptions(CompOpts: TLazCompilerOptions); Procedure SetDefaultModuleCompileOptions(CompOpts: TLazCompilerOptions); @@ -143,11 +142,6 @@ begin SetPasJSCompileOptions(CompOpts,'browser','-Jeutf-8 -Jirtl.js -Jc -Jminclude'); end; -procedure SetDefaultServiceWorkerCompileOptions(CompOpts: TLazCompilerOptions); -begin - SetPasJSCompileOptions(CompOpts,'browser','-Jeutf-8 -Jirtl.js -Jc -Jminclude'); -end; - Procedure SetDefaultNodeJSCompileOptions(CompOpts: TLazCompilerOptions); begin