callAsConstructor<T> method
Calls this JSFunction as a constructor with up to four arguments and returns the constructed JSObject.
TODO(srujzs): This helper doesn't allow passing nulls, as we use null as our sentinel to determine if an argument is passed.
Implementation
T callAsConstructor<T>(
[JSAny? arg1, JSAny? arg2, JSAny? arg3, JSAny? arg4]) =>
_callAsConstructor(arg1, arg2, arg3, arg4) as T;