* Patch from Mattias Gaertner to avoid some non-set function results

git-svn-id: trunk@34096 -
This commit is contained in:
michael 2016-07-11 11:43:36 +00:00
parent d36e882d1a
commit 1606976cfa

View File

@ -80,25 +80,33 @@ end;
function TJSValue.GetAsNumber: TJSNumber;
begin
If (ValueType=jstNumber) then
Result:=FValue.F;
Result:=FValue.F
else
Result:=0.0;
end;
function TJSValue.GetAsObject: TObject;
begin
If (ValueType=jstObject) then
Result:=TObject(FValue.P);
Result:=TObject(FValue.P)
else
Result:=nil;
end;
function TJSValue.GetAsReference: TObject;
begin
If (ValueType=jstReference) then
Result:=TObject(FValue.P);
Result:=TObject(FValue.P)
else
Result:=nil;
end;
function TJSValue.GetAsString: TJSString;
begin
If (ValueType=jstString) then
Result:=String(FValue.P);
Result:=String(FValue.P)
else
Result:='';
end;
function TJSValue.GetIsNull: Boolean;