Use importjs (#17422)

This commit is contained in:
konsumlamm 2021-03-19 22:22:48 +01:00 • committed by GitHub
commit 9997b42c35
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 56 additions and 56 deletions

View file

@ -3,8 +3,8 @@
when not defined(js):
{.fatal: "Module jsbigints is designed to be used with the JavaScript backend.".}
type JsBigIntImpl {.importc: "bigint".} = int # https://github.com/nim-lang/Nim/pull/16606
type JsBigInt* = distinct JsBigIntImpl ## Arbitrary precision integer for JavaScript target.
type JsBigIntImpl {.importjs: "bigint".} = int # https://github.com/nim-lang/Nim/pull/16606
type JsBigInt* = distinct JsBigIntImpl ## Arbitrary precision integer for JavaScript target.
func big*(integer: SomeInteger): JsBigInt {.importjs: "BigInt(#)".} =
## Constructor for `JsBigInt`.