napi_get_new_target
napi_status napi_get_new_target(napi_env env,
napi_callback_info cbinfo,
napi_value* result) [in] env:调用该 API 时所处的环境。[in] cbinfo:传递给回调函数的回调信息。[out] result:构造函数调用的new.target。
如果 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.】