2023-01-13 02:51:32 -05:00
|
|
|
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
|
|
|
|
2023-01-11 09:47:26 -05:00
|
|
|
use crate::assert_napi_ok;
|
|
|
|
use crate::napi_new_property;
|
2022-10-07 06:54:01 -04:00
|
|
|
use napi_sys::*;
|
|
|
|
use std::ptr;
|
|
|
|
|
|
|
|
extern "C" fn test_get_undefined(
|
|
|
|
env: napi_env,
|
|
|
|
_: napi_callback_info,
|
|
|
|
) -> napi_value {
|
|
|
|
let mut result = ptr::null_mut();
|
2023-01-11 09:47:26 -05:00
|
|
|
assert_napi_ok!(napi_get_undefined(env, &mut result));
|
2022-10-07 06:54:01 -04:00
|
|
|
result
|
|
|
|
}
|
|
|
|
|
|
|
|
pub fn init(env: napi_env, exports: napi_value) {
|
2023-01-11 09:47:26 -05:00
|
|
|
let properties = &[napi_new_property!(
|
2022-10-07 06:54:01 -04:00
|
|
|
env,
|
2023-01-11 09:47:26 -05:00
|
|
|
"test_get_undefined",
|
2022-10-07 06:54:01 -04:00
|
|
|
test_get_undefined
|
|
|
|
)];
|
|
|
|
|
2023-01-11 09:47:26 -05:00
|
|
|
assert_napi_ok!(napi_define_properties(
|
|
|
|
env,
|
|
|
|
exports,
|
|
|
|
properties.len(),
|
|
|
|
properties.as_ptr()
|
|
|
|
));
|
2022-10-07 06:54:01 -04:00
|
|
|
}
|