mirror of
https://github.com/nim-lang/Nim.git
synced 2026-04-23 07:45:23 +00:00
Support undefined in isNil (#9960)
This commit is contained in:
committed by
Andreas Rumpf
parent
062d7e3a39
commit
aadbdd6b06
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user