| 47 | } |
| 48 | |
| 49 | Value 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 | |
| 69 | Value TestTooBigBigInt(const CallbackInfo& info) { |
| 70 | int sign_bit = 0; |
no test coverage detected