Attribute Macro constructor_callback

Source
#[constructor_callback]
Expand description

Transforms a Rust function into a C function for being used as a JavaScript constructor callback.

This constructor_callback procedural macro transforms a Rust function of type:

fn(
    context: &JSContext,
    constructor: Option<&JSObject>,
    arguments: &[JSValue]
) -> Result<JSValue, JSException>

into a javascriptcore_sys::JSObjectCallAsConstructorCallback function.

Check the documentation of javascriptcore::JSClass::new to learn more.