napi_get_new_target
napi_status napi_get_new_target(napi_env env,
napi_callback_info cbinfo,
napi_value* result) -
[in] env:调用 API 的环境。¥
[in] env: The environment that the API is invoked under. -
[in] cbinfo:传递给回调函数的回调信息。¥
[in] cbinfo: The callback info passed into the callback function. -
[out] result:构造函数调用的new.target。¥
[out] result: Thenew.targetof the constructor call.
如果 API 成功,则返回 napi_ok。
¥Returns napi_ok if the API succeeded.
此 API 返回构造函数调用的 new.target。如果当前回调不是构造函数调用,则结果为 NULL。
¥This API returns the new.target of the constructor call. If the current
callback is not a constructor call, the result is NULL.