mirror of
https://github.com/nim-lang/Nim.git
synced 2026-04-20 14:25:23 +00:00
This commit is contained in:
@@ -438,7 +438,7 @@ macro `%*`*(x: untyped): untyped =
|
||||
## `%` for every element.
|
||||
result = toJsonImpl(x)
|
||||
|
||||
proc `==`*(a, b: JsonNode): bool {.noSideEffect.} =
|
||||
proc `==`*(a, b: JsonNode): bool {.noSideEffect, raises: [].} =
|
||||
## Check two nodes for equality
|
||||
if a.isNil:
|
||||
if b.isNil: return true
|
||||
@@ -458,7 +458,8 @@ proc `==`*(a, b: JsonNode): bool {.noSideEffect.} =
|
||||
of JNull:
|
||||
result = true
|
||||
of JArray:
|
||||
result = a.elems == b.elems
|
||||
{.cast(raises: []).}: # bug #19303
|
||||
result = a.elems == b.elems
|
||||
of JObject:
|
||||
# we cannot use OrderedTable's equality here as
|
||||
# the order does not matter for equality here.
|
||||
|
||||
@@ -44,3 +44,14 @@ proc fail() = discard
|
||||
f1()
|
||||
f2()
|
||||
|
||||
import std/json
|
||||
|
||||
# bug #22254
|
||||
proc senri(a, b: seq[JsonNode]) {.raises: [].} = discard a == b
|
||||
|
||||
# bug #22253
|
||||
proc serika() {.raises: [].} = discard default(JsonNode) == nil
|
||||
|
||||
senri(@[newJBool(true)], @[newJBool(false)])
|
||||
serika()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user