Browse Source

* Foreach callback can be reference to

Michaël Van Canneyt 3 years ago
parent
commit
a2de03435d
1 changed files with 3 additions and 4 deletions
  1. 3 4
      packages/rtl/web.pas

+ 3 - 4
packages/rtl/web.pas

@@ -141,15 +141,14 @@ TEventListenerEvent = class external name 'EventListener_Event' (TJSObject)
   end;
   end;
 
 
 
 
-  TJSNodeListCallBack = procedure (currentValue : TJSNode; currentIndex: NativeInt; list : TJSNodeList);
-  TJSNodeListEvent = procedure (currentValue : TJSNode; currentIndex: NativeInt; list : TJSNodeList) of object;
-  
+  TJSNodeListCallBack = reference to procedure (currentValue : TJSNode; currentIndex: NativeInt; list : TJSNodeList);
+  TJSNodeListEvent = TJSNodeListCallBack;
+
   TJSNodeList = class external name 'NodeList' (TJSObject)
   TJSNodeList = class external name 'NodeList' (TJSObject)
   Private
   Private
     FLength : NativeInt; external name 'length';
     FLength : NativeInt; external name 'length';
   Public
   Public
     procedure forEach(const aCallBack : TJSNodeListCallBack);
     procedure forEach(const aCallBack : TJSNodeListCallBack);
-    procedure forEach(const aCallBack : TJSNodeListEvent);
     function item(aIndex : NativeInt) : TJSNode;
     function item(aIndex : NativeInt) : TJSNode;
     Property length : NativeInt Read FLength;
     Property length : NativeInt Read FLength;
     Property Nodes [aIndex : NativeInt] : TJSNode Read item; default;
     Property Nodes [aIndex : NativeInt] : TJSNode Read item; default;