Skip to content

Commit e3cc237

Browse files
committed
squash! comments
1 parent aea9def commit e3cc237

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

doc/bigint.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ static BigInt New(Napi::Env env, int64_t value);
1111
static BigInt New(Napi::Env env, uint64_t value);
1212
```
1313
14-
- `[in] env`: The `napi_env` Environment
15-
- `[in] value`: The value the JavaScript BigInt will contain
14+
- `[in] env`: The environment in which to construct the `BigInt` object.
15+
- `[in] value`: The value the JavaScript `BigInt` will contain
1616
1717
These APIs convert the C `int64_t` and `uint64_t` types to the JavaScript
1818
`BigInt` type.
@@ -24,8 +24,8 @@ static BigInt New(Napi::Env env,
2424
const uint64_t* words);
2525
```
2626

27-
- `[in] env`: The `napi_env` Environment
28-
- `[in] sign_bit`: Determines if the resulting BigInt will be positive or negative.
27+
- `[in] env`: The environment in which to construct the `BigInt` object.
28+
- `[in] sign_bit`: Determines if the resulting `BigInt` will be positive or negative.
2929
- `[in] word_count`: The length of the words array.
3030
- `[in] words`: An array of `uint64_t` little-endian 64-bit words.
3131

@@ -41,7 +41,7 @@ The resulting `BigInt` is calculated as: (–1)<sup>`sign_bit`</sup> (`words[0]`
4141
Napi::BigInt();
4242
```
4343

44-
Returns a new empty JavaScript BigInt.
44+
Returns a new empty JavaScript `BigInt`.
4545

4646

4747
### Int64Value
@@ -50,44 +50,44 @@ Returns a new empty JavaScript BigInt.
5050
int64_t Int64Value(bool* lossless) const;
5151
```
5252
53-
- `[out] lossless`: Indicates whether the BigInt value was converted
53+
- `[out] lossless`: Indicates whether the `BigInt` value was converted
5454
losslessly.
5555
5656
This API returns the C `int64_t` primitive equivalent of the given JavaScript
57-
BigInt. If needed it will truncate the value, setting lossless to false.
57+
`BigInt`. If needed it will truncate the value, setting lossless to false.
5858
5959
### Uint64Value
6060
6161
```cpp
6262
uint64_t Uint64Value(bool* lossless) const;
6363
```
6464

65-
- `[out] lossless`: Indicates whether the BigInt value was converted
65+
- `[out] lossless`: Indicates whether the `BigInt` value was converted
6666
losslessly.
6767

6868
This API returns the C `uint64_t` primitive equivalent of the given JavaScript
69-
BigInt. If needed it will truncate the value, setting lossless to false.
69+
`BigInt`. If needed it will truncate the value, setting lossless to false.
7070

7171
### WordCount
7272

7373
```cpp
7474
size_t WordCount() const;
7575
```
7676

77-
Returns the number of words needed to store this BigInt value.
77+
Returns the number of words needed to store this `BigInt` value.
7878

7979
### ToWords
8080

8181
```cpp
8282
void ToWords(size_t* word_count, int* sign_bit, uint64_t* words);
8383
```
8484
85-
- `[out] sign_bit`: Integer representing if the JavaScript BigInt is positive
85+
- `[out] sign_bit`: Integer representing if the JavaScript `BigInt` is positive
8686
or negative.
8787
- `[in/out] word_count`: Must be initialized to the length of the words array.
8888
Upon return, it will be set to the actual number of words that would be
89-
needed to store this BigInt.
89+
needed to store this `BigInt`.
9090
- `[out] words`: Pointer to a pre-allocated 64-bit word array.
9191
92-
This API converts a single BigInt value into a sign bit, 64-bit little-endian
92+
This API converts a single `BigInt` value into a sign bit, 64-bit little-endian
9393
array, and the number of elements in the array.

test/bigint.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ Value TestWords(const CallbackInfo& info) {
4848

4949
if (word_count != expected_word_count) {
5050
Error::New(info.Env(), "word count did not match").ThrowAsJavaScriptException();
51-
return;
51+
return BigInt();
5252
}
5353

5454
return BigInt::New(info.Env(), sign_bit, word_count, words);

0 commit comments

Comments
 (0)