Support undefined in isNil (#9960)

This commit is contained in:
Alexander Ivanov
2018-12-30 03:48:37 +02:00
committed by Andreas Rumpf
parent 062d7e3a39
commit aadbdd6b06
3 changed files with 26 additions and 3 deletions

View File

@@ -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