Merge pull request #1283 from fowlmouth/patch-4

fix json.`[]`
This commit is contained in:
Varriount
2014-06-18 17:36:32 -04:00

View File

@@ -679,8 +679,8 @@ proc `[]`*(node: PJsonNode, name: string): PJsonNode =
proc `[]`*(node: PJsonNode, index: int): PJsonNode =
## Gets the node at `index` in an Array. Result is undefined if `index`
## is out of bounds
assert(not isNil(node))
assert(node.kind == JArray)
assert(node != nil)
return node.elems[index]
proc hasKey*(node: PJsonNode, key: string): bool =