mirror of
https://gitlab.com/freepascal.org/fpc/pas2js.git
synced 2025-09-02 14:50:27 +02:00
nodejs: fixed GetEnvironmentVariable on non existing vars
This commit is contained in:
parent
bbdda51fee
commit
45a382eef3
@ -63,8 +63,14 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
function MyGetEnvironmentVariable(Const EnvVar: String): String;
|
function MyGetEnvironmentVariable(Const EnvVar: String): String;
|
||||||
|
var
|
||||||
|
v: JSValue;
|
||||||
begin
|
begin
|
||||||
Result:=String(TNJSProcess.env[EnvVar]);
|
v:=TNJSProcess.env[EnvVar];
|
||||||
|
if isString(v) then
|
||||||
|
Result:=String(v)
|
||||||
|
else
|
||||||
|
Result:='';
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function MyGetEnvironmentVariableCount: Integer;
|
function MyGetEnvironmentVariableCount: Integer;
|
||||||
|
Loading…
Reference in New Issue
Block a user