* improve test coverage for isolation * a bit better * rename channels to channels_builtin * follow up #17276 * fix * Update lib/std/private/jsutils.nim
This commit is contained in:
parent
6c1c8f51b3
commit
e332c20ba7
2 changed files with 11 additions and 3 deletions
|
|
@ -1,4 +1,4 @@
|
|||
when defined(js):
|
||||
when defined(js) or defined(nimdoc):
|
||||
import std/jsbigints
|
||||
|
||||
type
|
||||
|
|
@ -40,4 +40,12 @@ when defined(js):
|
|||
|
||||
proc isInteger*[T](x: T): bool {.importjs: "Number.isInteger(#)".}
|
||||
|
||||
proc isSafeInteger*[T](x: T): bool {.importjs: "Number.isSafeInteger(#)".}
|
||||
proc isSafeInteger*[T](x: T): bool {.importjs: "Number.isSafeInteger(#)".} =
|
||||
runnableExamples:
|
||||
import std/jsffi
|
||||
assert not "123".toJs.isSafeInteger
|
||||
assert 123.toJs.isSafeInteger
|
||||
assert 9007199254740991.toJs.isSafeInteger
|
||||
assert not 9007199254740992.toJs.isSafeInteger
|
||||
|
||||
let maxSafeInteger* {.importjs: "Number.MAX_SAFE_INTEGER".} : int64
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ const
|
|||
webUploadOutput = "web/upload"
|
||||
|
||||
var nimExe*: string
|
||||
const allowList = ["jsbigints.nim", "jsheaders.nim", "jsformdata.nim", "jsfetch.nim"]
|
||||
const allowList = ["jsbigints.nim", "jsheaders.nim", "jsformdata.nim", "jsfetch.nim", "jsutils.nim"]
|
||||
|
||||
template isJsOnly(file: string): bool =
|
||||
file.isRelativeTo("lib/js") or
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue