callMethod method - JSObjectUnsafeUtilExtension extension - dart:js_interop_unsafe library (original) (raw)
callMethod<R extends JSAny?> method
R callMethod<R extends JSAny?>(
Calls method
on this JSObject with up to four arguments.
Returns the result of calling method
, which must be an R
.
This helper doesn't allow passing nulls, as it determines whether an argument is passed based on whether it was null or not. PrefercallMethodVarArgs if you need to pass nulls.
Implementation
R callMethod<R extends JSAny?>(
JSAny method, [
JSAny? arg1,
JSAny? arg2,
JSAny? arg3,
JSAny? arg4,
]) => _callMethod(method, arg1, arg2, arg3, arg4) as R;