Function script::dom::bindings::import::module::jsapi::IsConstructor

source ยท
pub unsafe extern "C" fn IsConstructor(obj: *mut JSObject) -> bool
Expand description

Return true if the given object is a constructor. In ES6 terms, an object is a constructor if it has a [Construct] internal method. The expression new obj() throws a TypeError if obj is not a constructor.

Implements: ES6 7.2.4 IsConstructor(argument).

JS functions and classes are constructors. Arrow functions and most builtin functions are not. A scripted proxy or wrapper is a constructor if its target is a constructor.