callAsConstructor method - JSFunctionUnsafeUtilExtension extension - dart:js_interop_unsafe library (original) (raw)
R callAsConstructor<R>([
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. PrefercallAsConstructorVarArgs 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;