Skip to content

Commit

Permalink
feat(neon): JsBigInt
Browse files Browse the repository at this point in the history
  • Loading branch information
kjvalencik committed Feb 7, 2023
1 parent 11b80e4 commit ca6b452
Show file tree
Hide file tree
Showing 10 changed files with 1,127 additions and 2 deletions.
115 changes: 113 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

34 changes: 34 additions & 0 deletions crates/neon/src/sys/bindings/functions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,40 @@ mod napi6 {
) -> Status;

fn get_instance_data(env: Env, data: *mut *mut c_void) -> Status;

fn create_bigint_int64(env: Env, value: i64, result: *mut Value) -> Status;

fn create_bigint_uint64(env: Env, value: u64, result: *mut Value) -> Status;

fn create_bigint_words(
env: Env,
sign_bit: i32,
word_count: usize,
words: *const u64,
result: *mut Value,
) -> Status;

fn get_value_bigint_int64(
env: Env,
value: Value,
result: *mut i64,
lossless: *mut bool,
) -> Status;

fn get_value_bigint_uint64(
env: Env,
value: Value,
result: *mut u64,
lossless: *mut bool,
) -> Status;

fn get_value_bigint_words(
env: Env,
value: Value,
sign_bit: *mut i64,
word_count: *mut usize,
words: *mut u64,
) -> Status;
}
);
}
Expand Down
5 changes: 5 additions & 0 deletions crates/neon/src/sys/tag.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,3 +132,8 @@ pub unsafe fn check_object_type_tag(env: Env, object: Local, tag: &super::TypeTa
);
result
}

#[cfg(feature = "napi-6")]
pub unsafe fn is_bigint(env: Env, val: Local) -> bool {
is_type(env, val, napi::ValueType::BigInt)
}
Loading

0 comments on commit ca6b452

Please sign in to comment.