pub unsafe extern "C" fn JSObjectMakeConstructor(
ctx: JSContextRef,
jsClass: JSClassRef,
callAsConstructor: JSObjectCallAsConstructorCallback,
) -> JSObjectRef
Expand description
Convenience method for creating a JavaScript constructor.
ctx
: The execution context to use.jsClass
: AJSClassRef
that is the class your constructor will assign to the objects its constructs.jsClass
will be used to set the constructor’s.prototype
property, and to evaluateinstanceof
expressions. PassNULL
to use the default object class.callAsConstructor
AJSObjectCallAsConstructorCallback
to invoke when your constructor is used in anew
expression. PassNULL
to use the default object constructor.
Returns a JSObjectRef
that is a constructor. The object’s
prototype will be the default object prototype.
The default object constructor takes no arguments and constructs
an object of class jsClass
with no private data.