mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-15 23:29:13 +02:00
fcl-js: fixed TBufferWriter on nodejs
This commit is contained in:
parent
20ac72e7aa
commit
c90503812a
@ -384,9 +384,14 @@ end;
|
|||||||
procedure TBufferWriter.SetCapacity(AValue: Cardinal);
|
procedure TBufferWriter.SetCapacity(AValue: Cardinal);
|
||||||
begin
|
begin
|
||||||
if FCapacity=AValue then Exit;
|
if FCapacity=AValue then Exit;
|
||||||
|
{$ifdef pas2js}
|
||||||
|
// capacity not needed, FBuffer is an JS array
|
||||||
|
FCapacity:=AValue;
|
||||||
|
{$else}
|
||||||
SetLength(FBuffer,AValue);
|
SetLength(FBuffer,AValue);
|
||||||
if (FBufPos>Capacity) then
|
if (FBufPos>Capacity) then
|
||||||
FBufPos:=Capacity;
|
FBufPos:=Capacity;
|
||||||
|
{$endif}
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TBufferWriter.DoWrite(const S: TJSWriterString): integer;
|
function TBufferWriter.DoWrite(const S: TJSWriterString): integer;
|
||||||
|
Loading…
Reference in New Issue
Block a user