From adb2508fdf1f5343ad7095a7486c26499823b572 Mon Sep 17 00:00:00 2001 From: LongYinan Date: Sat, 28 Jan 2023 14:53:31 +0800 Subject: [PATCH] fix(napi): add missing NoExternalBuffersAllowed (#1457) --- crates/napi/src/status.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/crates/napi/src/status.rs b/crates/napi/src/status.rs index 32d8c3f5..0b20bcc3 100644 --- a/crates/napi/src/status.rs +++ b/crates/napi/src/status.rs @@ -29,6 +29,7 @@ pub enum Status { ArrayBufferExpected, DetachableArraybufferExpected, WouldDeadlock, + NoExternalBuffersAllowed, Unknown = 1024, // unknown status. for example, using napi3 module in napi7 Node.js, and generate an invalid napi3 status } @@ -64,6 +65,7 @@ impl From for Status { sys::Status::napi_arraybuffer_expected => Status::ArrayBufferExpected, sys::Status::napi_detachable_arraybuffer_expected => Status::DetachableArraybufferExpected, sys::Status::napi_would_deadlock => Status::WouldDeadlock, + sys::Status::napi_no_external_buffers_allowed => Status::NoExternalBuffersAllowed, _ => Status::Unknown, } } @@ -94,6 +96,7 @@ impl From for i32 { Status::ArrayBufferExpected => sys::Status::napi_arraybuffer_expected, Status::DetachableArraybufferExpected => sys::Status::napi_detachable_arraybuffer_expected, Status::WouldDeadlock => sys::Status::napi_would_deadlock, + Status::NoExternalBuffersAllowed => sys::Status::napi_no_external_buffers_allowed, Status::Unknown => sys::Status::napi_generic_failure, } }