mirror of
https://gitlab.com/freepascal.org/fpc/pas2js.git
synced 2025-08-23 19:19:18 +02:00
* Merging revisions 915 from trunk:
------------------------------------------------------------------------ r915 | michael | 2020-11-05 09:34:37 +0100 (Thu, 05 Nov 2020) | 1 line * Avoid returning undefined when getting field data ------------------------------------------------------------------------
This commit is contained in:
commit
3091868cf5
@ -3162,6 +3162,8 @@ function TDataSet.GetFieldData(Field: TField; Buffer: TDatarecord): JSValue;
|
|||||||
|
|
||||||
begin
|
begin
|
||||||
Result:=TJSObject(buffer.data).Properties[Field.FieldName];
|
Result:=TJSObject(buffer.data).Properties[Field.FieldName];
|
||||||
|
if isUndefined(Result) then
|
||||||
|
Result:=Null;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
@ -5563,7 +5565,11 @@ begin
|
|||||||
If FValidating then
|
If FValidating then
|
||||||
result:=FValueBuffer
|
result:=FValueBuffer
|
||||||
else
|
else
|
||||||
|
begin
|
||||||
Result:=FDataset.GetFieldData(Self);
|
Result:=FDataset.GetFieldData(Self);
|
||||||
|
If IsUndefined(Result) then
|
||||||
|
Result:=Null;
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TField.GetDataSize: Integer;
|
function TField.GetDataSize: Integer;
|
||||||
|
@ -1698,6 +1698,8 @@ begin
|
|||||||
R:=Buffer.data;
|
R:=Buffer.data;
|
||||||
end;
|
end;
|
||||||
Result:=FFieldMapper.GetJSONDataForField(Field,R);
|
Result:=FFieldMapper.GetJSONDataForField(Field,R);
|
||||||
|
if isUndefined(Result) then
|
||||||
|
Result:=Null;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TBaseJSONDataSet.SetFieldData(Field: TField; var Buffer: TDatarecord; AValue : JSValue);
|
procedure TBaseJSONDataSet.SetFieldData(Field: TField; var Buffer: TDatarecord; AValue : JSValue);
|
||||||
|
Loading…
Reference in New Issue
Block a user