fix(napi): add missing NoExternalBuffersAllowed (#1457)
This commit is contained in:
parent
134eb8e19b
commit
adb2508fdf
1 changed files with 3 additions and 0 deletions
|
@ -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<i32> 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<Status> 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,
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue