Function mozjs::jsapi::Construct

source ·
pub unsafe extern "C" fn Construct(
    cx: *mut JSContext,
    fun: Handle<Value>,
    newTarget: Handle<*mut JSObject>,
    args: *const HandleValueArray,
    objp: MutableHandle<*mut JSObject>
) -> bool
Expand description

Invoke a constructor. This is the C++ equivalent of rval = Reflect.construct(fun, args, newTarget).

Construct() takes a newTarget argument that most callers don’t need. Consider using the four-argument Construct signature instead. (But if you’re implementing a subclass or a proxy handler’s construct() method, this is the right function to call.)

Implements: ES6 7.3.13 Construct(F, [argumentsList], [newTarget]). Use this function to invoke the [Construct] internal method.