SyntaxError
June 16, 2023 ยท View on GitHub
The Napi::SyntaxError class is a representation of the JavaScript
SyntaxError that is thrown when the engine encounters tokens or token order
that does not conform to the syntax of the language when parsing code.
The Napi::SyntaxError class inherits its behaviors from the Napi::Error
class (for more info see: Napi::Error).
For more details about error handling refer to the section titled Error handling.
Methods
New
Creates a new instance of a Napi::SyntaxError object.
Napi::SyntaxError::New(Napi::Env env, const char* message);
[in] Env: The environment in which to construct theNapi::SyntaxErrorobject.[in] message: Null-terminated string to be used as the message for theNapi::SyntaxError.
Returns an instance of a Napi::SyntaxError object.
New
Creates a new instance of a Napi::SyntaxError object.
Napi::SyntaxError::New(Napi::Env env, const std::string& message);
[in] Env: The environment in which to construct theNapi::SyntaxErrorobject.[in] message: Reference string to be used as the message for theNapi::SyntaxError.
Returns an instance of a Napi::SyntaxError object.
Constructor
Creates a new empty instance of a Napi::SyntaxError.
Napi::SyntaxError::SyntaxError();
Constructor
Initializes a Napi::SyntaxError instance from an existing Javascript error
object.
Napi::SyntaxError::SyntaxError(napi_env env, napi_value value);
[in] Env: The environment in which to construct theNapi::SyntaxErrorobject.[in] value: TheNapi::Errorreference to wrap.
Returns an instance of a Napi::SyntaxError object.