summary refs log tree commit diff stats
path: root/compiler/jsgen.nim
diff options
context:
space:
mode:
authorAlbert Safin <xzfcpw@gmail.com>2019-08-31 09:46:13 +0000
committerAlbert Safin <xzfcpw@gmail.com>2019-08-31 10:16:26 +0000
commitefe1bed82e8fa9476b4c9ed2a85802f6fb222cc6 (patch)
treef12af830435549f9f9830aafdb672909ffb6ee9a /compiler/jsgen.nim
parent9ae0dd611f77c4cd7122e6ac77e0278c1bafbbd7 (diff)
downloadNim-efe1bed82e8fa9476b4c9ed2a85802f6fb222cc6.tar.gz
Allow typeof(nil) as a return type
Diffstat (limited to 'compiler/jsgen.nim')
-rw-r--r--compiler/jsgen.nim2
1 files changed, 2 insertions, 0 deletions
diff --git a/compiler/jsgen.nim b/compiler/jsgen.nim
index 107fa2b28..1d980ab6f 100644
--- a/compiler/jsgen.nim
+++ b/compiler/jsgen.nim
@@ -1600,6 +1600,8 @@ proc createVar(p: PProc, typ: PType, indirect: bool): Rope =
     result = putToSeq("{}", indirect)
   of tyBool:
     result = putToSeq("false", indirect)
+  of tyNil:
+    result = putToSeq("null", indirect)
   of tyArray:
     let length = toInt(lengthOrd(p.config, t))
     let e = elemType(t)