mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-10-24 05:37:41 +02:00
fcl-passrc: fixed hashlist for pas2js
git-svn-id: trunk@40137 -
This commit is contained in:
parent
46b1838d60
commit
42c2859ce4
@ -2577,13 +2577,8 @@ begin
|
||||
end;
|
||||
|
||||
procedure TPasResHashList.Clear;
|
||||
var
|
||||
Arr: TStringDynArray;
|
||||
i: Integer;
|
||||
begin
|
||||
Arr:=TJSObject.getOwnPropertyNames(FItems);
|
||||
for i:=0 to length(Arr)-1 do
|
||||
JSDelete(FItems,Arr[i]);
|
||||
FItems:=TJSObject.new;
|
||||
end;
|
||||
|
||||
procedure TPasResHashList.Remove(const aName: string);
|
||||
@ -2591,7 +2586,6 @@ begin
|
||||
if FItems.hasOwnProperty('%'+aName) then
|
||||
JSDelete(FItems,'%'+aName);
|
||||
end;
|
||||
|
||||
{$endif}
|
||||
|
||||
{ TResElDataBuiltInProc }
|
||||
@ -3511,6 +3505,11 @@ begin
|
||||
end;
|
||||
FItems.Add(LoName,Item);
|
||||
{$IFDEF VerbosePasResolver}
|
||||
if Item.Owner<>nil then
|
||||
raise Exception.Create('20160925184110');
|
||||
Item.Owner:=Self;
|
||||
{$ENDIF}
|
||||
{$IFDEF VerbosePasResolver}
|
||||
if FindIdentifier(Item.Identifier)<>Item then
|
||||
raise Exception.Create('20181018173201');
|
||||
{$ENDIF}
|
||||
@ -4023,7 +4022,7 @@ begin
|
||||
|
||||
{$IFDEF VerbosePasResolver}
|
||||
writeln('TPasResolver.OnFindCallElements Proc Distance=',Distance,
|
||||
' Data^.Found=',Data^.Found<>nil,' Data^.Distance=',ord(Data^.Distance),
|
||||
' Data^.Found=',Data^.Found<>nil,' Data^.Distance=',Data^.Distance,
|
||||
' Signature={',GetProcTypeDescription(Proc.ProcType,[prptdUseName,prptdAddPaths]),'}',
|
||||
' Abort=',Abort);
|
||||
{$ENDIF}
|
||||
@ -16778,6 +16777,10 @@ begin
|
||||
btWideString,btUnicodeString:
|
||||
Result:=cCompatible;
|
||||
else
|
||||
{$IFDEF VerbosePasResolver}
|
||||
writeln('TPasResolver.CheckAssignResCompatibility ',{$ifdef pas2js}str(LBT){$else}LBT{$ENDIF});
|
||||
writeln('AAA1 TPasResolver.CheckAssignResCompatibility ',str(BaseTypeChar),' ',str(BaseTypeString));
|
||||
{$ENDIF}
|
||||
RaiseNotYetImplemented(20170417195208,ErrorEl,BaseTypeNames[LBT]);
|
||||
end
|
||||
else if RBT=btContext then
|
||||
@ -19813,6 +19816,15 @@ begin
|
||||
FBaseTypes[btString],FBaseTypes[btString],[rrfReadable])
|
||||
else
|
||||
RaiseNotYetImplemented(20160922163705,El);
|
||||
{$IF defined(nodejs) and defined(VerbosePasResolver)}
|
||||
if not isNumber(ResolvedEl.BaseType) then
|
||||
begin
|
||||
{AllowWriteln}
|
||||
writeln('TPasResolver.ComputeElement ',GetObjName(El),' typeof ResolvedEl.BaseType=',jsTypeOf(ResolvedEl.BaseType),' ResolvedEl=',GetResolverResultDbg(ResolvedEl));
|
||||
RaiseInternalError(20181101123527,jsTypeOf(ResolvedEl.LoTypeEl));
|
||||
{AllowWriteln-}
|
||||
end;
|
||||
{$ENDIF}
|
||||
end;
|
||||
|
||||
function TPasResolver.Eval(Expr: TPasExpr; Flags: TResEvalFlags;
|
||||
|
||||
@ -140,7 +140,7 @@ type
|
||||
class var FLastPasElementId: NativeInt;
|
||||
{$endif}
|
||||
{$ifdef EnablePasTreeGlobalRefCount}
|
||||
class var FGlobalRefCount: int64;
|
||||
class var FGlobalRefCount: NativeInt;
|
||||
{$endif}
|
||||
protected
|
||||
procedure ProcessHints(const ASemiColonPrefix: boolean; var AResult: string); virtual;
|
||||
@ -186,7 +186,7 @@ type
|
||||
property PasElementId: NativeInt read FPasElementId; // global unique id
|
||||
{$endif}
|
||||
{$ifdef EnablePasTreeGlobalRefCount}
|
||||
class property GlobalRefCount: int64 read FGlobalRefCount write FGlobalRefCount;
|
||||
class property GlobalRefCount: NativeInt read FGlobalRefCount write FGlobalRefCount;
|
||||
{$endif}
|
||||
end;
|
||||
|
||||
|
||||
@ -463,7 +463,7 @@ begin
|
||||
if ContainsItem(Item) then
|
||||
raise Exception.Create('TPasAnalyzerSet.Add duplicate');
|
||||
{$ifdef pas2js}
|
||||
FItems[FItemToName(Item)]:=Item;
|
||||
FItems['%'+FItemToName(Item)]:=Item;
|
||||
inc(FCount);
|
||||
{$else}
|
||||
FTree.Add(Item);
|
||||
@ -475,7 +475,7 @@ procedure TPasAnalyzerKeySet.Remove(Item: Pointer);
|
||||
var
|
||||
aName: string;
|
||||
begin
|
||||
aName:=FItemToName(Item);
|
||||
aName:='%'+FItemToName(Item);
|
||||
if not FItems.hasOwnProperty(aName) then exit;
|
||||
JSDelete(FItems,aName);
|
||||
dec(FCount);
|
||||
@ -489,7 +489,7 @@ end;
|
||||
function TPasAnalyzerKeySet.ContainsItem(Item: Pointer): boolean;
|
||||
begin
|
||||
{$ifdef pas2js}
|
||||
Result:=FItems.hasOwnProperty(FItemToName(Item));
|
||||
Result:=FItems.hasOwnProperty('%'+FItemToName(Item));
|
||||
{$else}
|
||||
Result:=FTree.Find(Item)<>nil;
|
||||
{$endif}
|
||||
@ -498,7 +498,7 @@ end;
|
||||
function TPasAnalyzerKeySet.ContainsKey(Key: Pointer): boolean;
|
||||
begin
|
||||
{$ifdef pas2js}
|
||||
Result:=FItems.hasOwnProperty(FKeyToName(Key));
|
||||
Result:=FItems.hasOwnProperty('%'+FKeyToName(Key));
|
||||
{$else}
|
||||
Result:=FTree.FindKey(Key,FCompareKeyWithData)<>nil;
|
||||
{$endif}
|
||||
@ -509,7 +509,7 @@ function TPasAnalyzerKeySet.FindItem(Item: Pointer): Pointer;
|
||||
var
|
||||
aName: string;
|
||||
begin
|
||||
aName:=FItemToName(Item);
|
||||
aName:='%'+FItemToName(Item);
|
||||
if not FItems.hasOwnProperty(aName) then
|
||||
exit(nil)
|
||||
else
|
||||
@ -532,7 +532,7 @@ function TPasAnalyzerKeySet.FindKey(Key: Pointer): Pointer;
|
||||
var
|
||||
aName: string;
|
||||
begin
|
||||
aName:=FKeyToName(Key);
|
||||
aName:='%'+FKeyToName(Key);
|
||||
if not FItems.hasOwnProperty(aName) then
|
||||
exit(nil)
|
||||
else
|
||||
|
||||
Loading…
Reference in New Issue
Block a user