Files

42 lines
1.1 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Darklord.js — dbCallAny() (satır 3102)
[← Darklord.js](index.md) · [← Master](../../wiki.md)
```javascript
function dbCallAny(object, names, args)
{
args = args || [];
if (!object) throw "Object yok";
for (var i = 0; i < names.length; i++)
{
try
{
var direct = object[names[i]];
if (typeof direct === "function") return direct.apply(object, args);
}
catch (e1) {}
}
var cls = object.getClass();
while (cls != null)
{
var methods = cls.getDeclaredMethods();
for (var m = 0; m < methods.length; m++)
{
var method = methods[m];
var name = String(method.getName());
if (names.indexOf(name) !== -1 && method.getParameterTypes().length === args.length)
{
method.setAccessible(true);
return method.invoke(object, Java.to(args, "java.lang.Object[]"));
}
}
cls = cls.getSuperclass();
}
throw "Method bulunamadi: " + names.join("/");
}
```