callAsConstructor<R> method
Calls this JSFunction as a constructor with up to four arguments.
Returns the constructed object, 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. Prefer callAsConstructorVarArgs if you need to pass nulls.
Implementation
// TODO(srujzs): The type bound should extend `JSObject`.
R callAsConstructor<R>(
[JSAny? arg1, JSAny? arg2, JSAny? arg3, JSAny? arg4]) =>
_callAsConstructor(arg1, arg2, arg3, arg4) as R;