mirror of
https://github.com/nim-lang/Nim.git
synced 2026-06-03 18:34:43 +00:00
* 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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user