Skip to content

Commit

Permalink
Use unaryMinus directly instead of internal implementation (#43)
Browse files Browse the repository at this point in the history
  • Loading branch information
kmalakoff authored Apr 14, 2022
1 parent a018f5f commit 351de40
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
4 changes: 1 addition & 3 deletions tests/as-int-n.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -285,9 +285,7 @@ const uintn_data = [

function parse(string) {
if (string.charCodeAt(0) === 0x2D) { // '-'
const result = JSBI.BigInt(string.slice(1));
result.sign = true;
return result;
return JSBI.unaryMinus(JSBI.BigInt(string.slice(1)));
}
return JSBI.BigInt(string);
}
Expand Down
4 changes: 1 addition & 3 deletions tests/tests.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,7 @@ const TESTS = [

function parse(string) {
if (string.charCodeAt(0) === 0x2D) { // '-'
const result = JSBI.BigInt(string.slice(1));
result.sign = true;
return result;
return JSBI.unaryMinus(JSBI.BigInt(string.slice(1)));
}
return JSBI.BigInt(string);
}
Expand Down

0 comments on commit 351de40

Please # to comment.