jSObjectMakeConstructor top-level property

Pointer<NativeType> Function(Pointer<NativeType> ctx, Pointer<NativeType> jsClass, Pointer<NativeFunction<JSObjectCallAsConstructorCallback>> callAsConstructor) jSObjectMakeConstructor
final

Convenience method for creating a JavaScript constructor. The default object constructor takes no arguments and constructs an object of class jsClass with no private data. ctx (JSContextRef) The execution context to use. jsClass (JSClassRef) A JSClass 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 evaluate 'instanceof' expressions. Pass NULL to use the default object class. callAsConstructor (JSObjectCallAsConstructorCallback) A JSObjectCallAsConstructorCallback to invoke when your constructor is used in a 'new' expression. Pass NULL to use the default object constructor. @result (JSObjectRef) A JSObject that is a constructor. The object's prototype will be the default object prototype.

Implementation

final Pointer Function(
    Pointer ctx,
    Pointer jsClass,
    Pointer<NativeFunction<JSObjectCallAsConstructorCallback>>
        callAsConstructor) jSObjectMakeConstructor = jscLib
    .lookup<NativeFunction<Pointer Function(Pointer, Pointer, Pointer)>>(
        'JSObjectMakeConstructor')
    .asFunction();