rtl: MethodName: support callbacks with function reference

This commit is contained in:
mattias 2019-10-21 16:44:47 +00:00
parent b1c084790f
commit a72e7bf311

View File

@ -852,10 +852,14 @@ begin
if aCode=Nil then
exit;
asm
if (typeof(aCode)!=='function') return "";
var i = 0;
var TI = this.$rtti;
// Callback ?
if ((typeof aCode["fn"] === "string") && (typeof aCode["scope"] === "object")) return aCode["fn"];
if (rtl.isObject(aCode.scope)){
// callback
if (typeof aCode.fn === "string") return aCode.fn;
aCode = aCode.fn;
}
// Not a callback, check rtti
while ((Result === "") && (TI != null)) {
i = 0;