diff --git a/napi/src/env.rs b/napi/src/env.rs index 7261b32f..5b675c57 100644 --- a/napi/src/env.rs +++ b/napi/src/env.rs @@ -215,6 +215,12 @@ impl Env { Ok(JsObject::from_raw_unchecked(self.0, raw_value)) } + pub fn create_array(&self) -> Result { + let mut raw_value = ptr::null_mut(); + check_status(unsafe { sys::napi_create_array(self.0, &mut raw_value) })?; + Ok(JsObject::from_raw_unchecked(self.0, raw_value)) + } + pub fn create_array_with_length(&self, length: usize) -> Result { let mut raw_value = ptr::null_mut(); check_status(unsafe {