diff options
author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2023-01-15 04:36:55 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-15 09:06:55 +0530 |
commit | df8bfa26be69af46b8f166e255330b5ba8d48893 (patch) | |
tree | e6aa1dec47e82d5cf2b3b01583a2c7fcb099e741 /test_napi/src/lib.rs | |
parent | e4c6e6e95f626b1ce8601f48344a76045f2d6479 (diff) |
fix(napi): functions related to errors (#17370)
This commits fixes various NAPI functions related to creation and
throwing of errors.
Diffstat (limited to 'test_napi/src/lib.rs')
-rw-r--r-- | test_napi/src/lib.rs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/test_napi/src/lib.rs b/test_napi/src/lib.rs index b54b3886b..c02e53da4 100644 --- a/test_napi/src/lib.rs +++ b/test_napi/src/lib.rs @@ -12,6 +12,7 @@ pub mod r#async; pub mod callback; pub mod coerce; pub mod date; +pub mod error; pub mod numbers; pub mod object_wrap; pub mod primitives; @@ -22,6 +23,13 @@ pub mod tsfn; pub mod typedarray; #[macro_export] +macro_rules! cstr { + ($s: literal) => {{ + std::ffi::CString::new($s).unwrap().as_ptr() + }}; +} + +#[macro_export] macro_rules! assert_napi_ok { ($call: expr) => {{ assert_eq!(unsafe { $call }, napi_sys::Status::napi_ok); @@ -127,6 +135,7 @@ unsafe extern "C" fn napi_register_module_v1( typedarray::init(env, exports); arraybuffer::init(env, exports); array::init(env, exports); + error::init(env, exports); primitives::init(env, exports); properties::init(env, exports); promise::init(env, exports); |