node_api_create_syntax_error
functionv9js_native_api.hThis API returns a JavaScript SyntaxError with the text provided.
NAPI_EXTERN napi_status node_api_create_syntax_error(napi_env env,
napi_value code,
napi_value msg,
napi_value* result);
[in] env: The environment that the API is invoked under.[in] code: Optionalnapi_valuewith the string for the error code to be associated with the error.[in] msg:napi_valuethat references a JavaScriptstringto be used as the message for theError.[out] result:napi_valuerepresenting the error created.
Returns napi_ok if the API succeeded.
This API returns a JavaScript SyntaxError with the text provided.