diff options
author | Billingsly Wetherfordshire <phowl.mouth@gmail.com> | 2014-06-19 13:00:11 -0500 |
---|---|---|
committer | Billingsly Wetherfordshire <phowl.mouth@gmail.com> | 2014-06-19 13:00:11 -0500 |
commit | bd8f5c8392fc6f28381170d029f67801789fd78d (patch) | |
tree | 986600122c975ce5266b054c5634ce3866d28e74 /lib | |
parent | be534279da5021aa5e6621430a52ee1573f1a01f (diff) | |
download | Nim-bd8f5c8392fc6f28381170d029f67801789fd78d.tar.gz |
json.== handles nil now
Diffstat (limited to 'lib')
-rw-r--r-- | lib/pure/json.nim | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/pure/json.nim b/lib/pure/json.nim index 4e369b854..871713f1c 100644 --- a/lib/pure/json.nim +++ b/lib/pure/json.nim @@ -621,9 +621,13 @@ proc `%`*(elements: openArray[PJsonNode]): PJsonNode = proc `==`* (a,b: PJsonNode): bool = ## Check two nodes for equality - if a.kind != b.kind: false + if a.isNil: + if b.isNil: return true + return false + elif b.isNil or a.kind != b.kind: + return false else: - case a.kind + return case a.kind of JString: a.str == b.str of JInt: |