mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-11 13:09:43 +02:00
fcl-js: fixed hashlist for pas2js
git-svn-id: trunk@40135 -
This commit is contained in:
parent
72bab28659
commit
b5e7566e55
@ -474,7 +474,7 @@ end;
|
|||||||
procedure TSourceMap.TStringToIndex.Add(const Value: String; Index: integer);
|
procedure TSourceMap.TStringToIndex.Add(const Value: String; Index: integer);
|
||||||
begin
|
begin
|
||||||
{$ifdef pas2js}
|
{$ifdef pas2js}
|
||||||
FItems[Value]:=Index;
|
FItems['%'+Value]:=Index;
|
||||||
{$else}
|
{$else}
|
||||||
// Note: nil=0 means not found in TFPHashList
|
// Note: nil=0 means not found in TFPHashList
|
||||||
FItems.Add(Value,{%H-}Pointer(PtrInt(Index+1)));
|
FItems.Add(Value,{%H-}Pointer(PtrInt(Index+1)));
|
||||||
@ -485,8 +485,8 @@ function TSourceMap.TStringToIndex.FindValue(const Value: String
|
|||||||
): integer;
|
): integer;
|
||||||
begin
|
begin
|
||||||
{$ifdef pas2js}
|
{$ifdef pas2js}
|
||||||
if FItems.hasOwnProperty(Value) then
|
if FItems.hasOwnProperty('%'+Value) then
|
||||||
Result:=integer(FItems[Value])
|
Result:=integer(FItems['%'+Value])
|
||||||
else
|
else
|
||||||
Result:=-1;
|
Result:=-1;
|
||||||
{$else}
|
{$else}
|
||||||
|
Loading…
Reference in New Issue
Block a user