pas2js: fixed uninitialized var, serviceworker targetos nodejs

This commit is contained in:
mattias 2022-05-12 12:34:49 +02:00
parent 80da9bee92
commit e7f787f78d
3 changed files with 3 additions and 7 deletions

View File

@ -387,6 +387,7 @@ begin
if WebDir='' then if WebDir='' then
exit(mrCancel); exit(mrCancel);
SWSLocation:=nil;
if Location<>'' then if Location<>'' then
begin begin
Location:=GetProjectLocation(aProject); Location:=GetProjectLocation(aProject);
@ -414,6 +415,7 @@ begin
debugln(['Info: TPJSController.RunProject missing htmlfile']); debugln(['Info: TPJSController.RunProject missing htmlfile']);
exit(mrCancel); exit(mrCancel);
end; end;
if SWSLocation<>nil then if SWSLocation<>nil then
begin begin
if not SimpleWebServerController.OpenBrowserWithLocation(SWSLocation,HTMLFilename) then if not SimpleWebServerController.OpenBrowserWithLocation(SWSLocation,HTMLFilename) then

View File

@ -840,7 +840,7 @@ begin
AProject.AddFile(MainFile,false); AProject.AddFile(MainFile,false);
AProject.MainFileID:=0; AProject.MainFileID:=0;
CompOpts:=AProject.LazCompilerOptions; CompOpts:=AProject.LazCompilerOptions;
SetDefaultServiceWorkerCompileOptions(CompOpts); SetDefaultNodeJSCompileOptions(CompOpts);
CompOpts.TargetFilename:=ExtractFileNameOnly(LPRFilename); CompOpts.TargetFilename:=ExtractFileNameOnly(LPRFilename);
SetDefaultServiceWorkerRunParams(AProject.RunParameters.GetOrCreate('Default')); SetDefaultServiceWorkerRunParams(AProject.RunParameters.GetOrCreate('Default'));
AProject.MainFile.SetSourceText(CreateProjectSource,true); AProject.MainFile.SetSourceText(CreateProjectSource,true);

View File

@ -63,7 +63,6 @@ Procedure SetDefaultWebRunParams(RunParams : TAbstractRunParamsOptionsMode);
Procedure SetDefaultServiceWorkerRunParams(RunParams : TAbstractRunParamsOptionsMode); Procedure SetDefaultServiceWorkerRunParams(RunParams : TAbstractRunParamsOptionsMode);
Procedure SetDefaultNodeRunParams(RunParams : TAbstractRunParamsOptionsMode); Procedure SetDefaultNodeRunParams(RunParams : TAbstractRunParamsOptionsMode);
Procedure SetDefaultWebCompileOptions(CompOpts: TLazCompilerOptions); Procedure SetDefaultWebCompileOptions(CompOpts: TLazCompilerOptions);
Procedure SetDefaultServiceWorkerCompileOptions(CompOpts: TLazCompilerOptions);
Procedure SetDefaultNodeJSCompileOptions(CompOpts: TLazCompilerOptions); Procedure SetDefaultNodeJSCompileOptions(CompOpts: TLazCompilerOptions);
Procedure SetDefaultModuleCompileOptions(CompOpts: TLazCompilerOptions); Procedure SetDefaultModuleCompileOptions(CompOpts: TLazCompilerOptions);
@ -143,11 +142,6 @@ begin
SetPasJSCompileOptions(CompOpts,'browser','-Jeutf-8 -Jirtl.js -Jc -Jminclude'); SetPasJSCompileOptions(CompOpts,'browser','-Jeutf-8 -Jirtl.js -Jc -Jminclude');
end; end;
procedure SetDefaultServiceWorkerCompileOptions(CompOpts: TLazCompilerOptions);
begin
SetPasJSCompileOptions(CompOpts,'browser','-Jeutf-8 -Jirtl.js -Jc -Jminclude');
end;
Procedure SetDefaultNodeJSCompileOptions(CompOpts: TLazCompilerOptions); Procedure SetDefaultNodeJSCompileOptions(CompOpts: TLazCompilerOptions);
begin begin