diff options
author | Albert Safin <xzfcpw@gmail.com> | 2019-08-31 09:46:13 +0000 |
---|---|---|
committer | Albert Safin <xzfcpw@gmail.com> | 2019-08-31 10:16:26 +0000 |
commit | efe1bed82e8fa9476b4c9ed2a85802f6fb222cc6 (patch) | |
tree | f12af830435549f9f9830aafdb672909ffb6ee9a /compiler/jsgen.nim | |
parent | 9ae0dd611f77c4cd7122e6ac77e0278c1bafbbd7 (diff) | |
download | Nim-efe1bed82e8fa9476b4c9ed2a85802f6fb222cc6.tar.gz |
Allow typeof(nil) as a return type
Diffstat (limited to 'compiler/jsgen.nim')
-rw-r--r-- | compiler/jsgen.nim | 2 |
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) |