napi_throw
NAPI_EXTERN napi_status napi_throw(napi_env env, napi_value error); -
[in] env:调用 API 的环境。¥
[in] env: The environment that the API is invoked under. -
[in] error:要抛出的 JavaScript 值。¥
[in] error: The JavaScript value to be thrown.
如果 API 成功,则返回 napi_ok。
¥Returns napi_ok if the API succeeded.
此 API 抛出提供的 JavaScript 值。
¥This API throws the JavaScript value provided.