1. napi_status napi_get_new_target(napi_env env,
    2. napi_callback_info cbinfo,
    3. napi_value* result)
    • [in] env: The environment that the API is invoked under.
    • [in] cbinfo: The callback info passed into the callback function.
    • [out] result: The new.target of the constructor call.

    Returns napi_ok if the API succeeded.

    This API returns the new.target of the constructor call. If the current callback is not a constructor call, the result is NULL.