From 351de40f4cfed836267d7391ad6f3a8ba3b2f245 Mon Sep 17 00:00:00 2001 From: Kevin Malakoff Date: Thu, 14 Apr 2022 13:54:28 -0700 Subject: [PATCH] Use unaryMinus directly instead of internal implementation (#43) --- tests/as-int-n.mjs | 4 +--- tests/tests.mjs | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/tests/as-int-n.mjs b/tests/as-int-n.mjs index 641230b..21ebae2 100644 --- a/tests/as-int-n.mjs +++ b/tests/as-int-n.mjs @@ -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); } diff --git a/tests/tests.mjs b/tests/tests.mjs index efca1ab..62d664c 100644 --- a/tests/tests.mjs +++ b/tests/tests.mjs @@ -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); }