Support undefined in isNil (#9960)
This commit is contained in:
parent
062d7e3a39
commit
aadbdd6b06
3 changed files with 26 additions and 3 deletions
|
|
@ -104,6 +104,12 @@ var
|
|||
jsFilename* {.importc: "__filename", nodecl.}: cstring
|
||||
## JavaScript's __filename pseudo-variable
|
||||
|
||||
proc isNull*[T](x: T): bool {.noSideEffect, importcpp: "(# === null)".}
|
||||
## check if a value is exactly null
|
||||
|
||||
proc isUndefined*[T](x: T): bool {.noSideEffect, importcpp: "(# === undefined)".}
|
||||
## check if a value is exactly undefined
|
||||
|
||||
# Exceptions
|
||||
type
|
||||
JsError* {.importc: "Error".} = object of JsRoot
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue