mirror of
https://gitlab.com/freepascal.org/fpc/pas2js.git
synced 2025-06-04 18:28:23 +02:00
rtl: MethodName: support callbacks with function reference
This commit is contained in:
parent
b1c084790f
commit
a72e7bf311
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user