Browse Source

rtl: fixed SetMethodProp normal function

mattias 5 years ago
parent
commit
07c76c5111
1 changed files with 4 additions and 1 deletions
  1. 4 1
      packages/rtl/typinfo.pas

+ 4 - 1
packages/rtl/typinfo.pas

@@ -1447,7 +1447,10 @@ begin
       end
       end
     else if isString(TJSObject(Code)['fn']) then
     else if isString(TJSObject(Code)['fn']) then
       // named callback, different scope
       // named callback, different scope
-      cb:=createCallbackStr(Value.Data,string(TJSObject(Code)['fn']));
+      cb:=createCallbackStr(Value.Data,string(TJSObject(Code)['fn']))
+    else
+      // normal function
+      cb:=createCallbackPtr(Value.Data,Code);
     end
     end
   else
   else
     // not a valid value -> for compatibility set it anyway
     // not a valid value -> for compatibility set it anyway