callAsConstructor<T> method

T callAsConstructor<T>(
  1. [JSAny? arg1,
  2. JSAny? arg2,
  3. JSAny? arg3,
  4. JSAny? arg4]
)

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;