MCPcopy Index your code
hub / github.com/nodejs/node-addon-api / TestWords

Function TestWords

test/bigint.cc:49–67  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

47}
48
49Value TestWords(const CallbackInfo& info) {
50 BigInt big = info[0].As<BigInt>();
51
52 size_t expected_word_count = big.WordCount();
53
54 int sign_bit;
55 size_t word_count = 10;
56 uint64_t words[10] = {0};
57
58 big.ToWords(&sign_bit, &word_count, words);
59
60 if (word_count != expected_word_count) {
61 Error::New(info.Env(), "word count did not match")
62 .ThrowAsJavaScriptException();
63 return BigInt();
64 }
65
66 return BigInt::New(info.Env(), sign_bit, word_count, words);
67}
68
69Value TestTooBigBigInt(const CallbackInfo& info) {
70 int sign_bit = 0;

Callers 1

testFunction · 0.85

Calls 3

BigIntClass · 0.85
EnvMethod · 0.80

Tested by

no test coverage detected