diff options
author | metagn <metagngn@gmail.com> | 2023-04-11 22:20:20 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-11 21:20:20 +0200 |
commit | f05387045df55bf7123ee68002238e943716815e (patch) | |
tree | 9ba7959434162830612e31351eadbae79cf3bc37 /lib/std/private | |
parent | be06446ffecd7665651a25d6b07fade5cc019296 (diff) | |
download | Nim-f05387045df55bf7123ee68002238e943716815e.tar.gz |
int64/uint64 as bigint in JS (#21613)
* int64/uint64 as bigint in JS * fix CI * convert to compile option * fix lie * smaller diff, changelog entry
Diffstat (limited to 'lib/std/private')
-rw-r--r-- | lib/std/private/jsutils.nim | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/lib/std/private/jsutils.nim b/lib/std/private/jsutils.nim index 836b3512a..fd1f395f3 100644 --- a/lib/std/private/jsutils.nim +++ b/lib/std/private/jsutils.nim @@ -79,5 +79,18 @@ when defined(js): assert not "123".toJs.isSafeInteger assert 123.isSafeInteger assert 123.toJs.isSafeInteger - assert 9007199254740991.toJs.isSafeInteger - assert not 9007199254740992.toJs.isSafeInteger + when false: + assert 9007199254740991.toJs.isSafeInteger + assert not 9007199254740992.toJs.isSafeInteger + +template whenJsNoBigInt64*(no64, yes64): untyped = + when defined(js): + when compiles(compileOption("jsbigint64")): + when compileOption("jsbigint64"): + yes64 + else: + no64 + else: + no64 + else: + no64 |