callMethod method
Implementation
dynamic callMethod(JSObject obj, String method, List<dynamic> args) {
switch (args.length) {
case 0:
return callMethod0(obj, method);
case 1:
return callMethod1(obj, method, args[0]);
case 2:
return callMethod2(obj, method, args[0], args[1]);
default:
// For 3+ arguments, fall back to VarArgs if needed
// Note: the cast does not work properly at the moment
return obj.callMethodVarArgs(method.toJS, args.cast<JSAny?>());
}
}