Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "JSON3"
uuid = "0f8b85d8-7281-11e9-16c2-39a750bddbf1"
authors = ["Jacob Quinn <quinn.jacobd@gmail.com>"]
version = "1.8.1"
version = "1.8.2"

[deps]
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
Expand Down
12 changes: 6 additions & 6 deletions src/structs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ end
pos += 1
return pos, T()
end
c = TupleClosure(buf, pos, len, b, kw.data)
c = TupleClosure(buf, pos, len, b, values(kw))
x = StructTypes.construct(c, T)

return c.pos, x
Expand Down Expand Up @@ -381,7 +381,7 @@ mutable struct MutableClosure{T, KW}
end

@inline function (f::MutableClosure)(i, nm, TT; kw...)
kw2 = merge(kw.data, f.kw)
kw2 = merge(values(kw), f.kw)
pos_i, y_i = read(StructType(TT), f.buf, f.pos, f.len, f.b, TT; kw2...)
f.pos = pos_i
return y_i
Expand Down Expand Up @@ -446,7 +446,7 @@ end
@eof
b = getbyte(buf, pos)
@wh
c = MutableClosure(buf, pos, len, b, kw.data)
c = MutableClosure(buf, pos, len, b, values(kw))
if StructTypes.applyfield!(c, x, key)
pos = c.pos
else
Expand Down Expand Up @@ -490,7 +490,7 @@ end
const DEFAULT_STRUCT_FIELD_COUNT = 32

@inline function (f::StructClosure)(i, nm, TT; kw...)
kw2 = merge(kw.data, f.kw)
kw2 = merge(values(kw), f.kw)
pos_i, y_i = read(StructType(TT), f.buf, f.pos, f.len, f.b, TT; kw2...)
f.pos = pos_i
if i <= DEFAULT_STRUCT_FIELD_COUNT
Expand Down Expand Up @@ -551,7 +551,7 @@ end
@eof
b = getbyte(buf, pos)
@wh
c = StructClosure(buf, pos, len, b, values, kw.data)
c = StructClosure(buf, pos, len, b, values, Base.values(kw))
if StructTypes.applyfield(c, T, key)
pos = c.pos
else
Expand Down Expand Up @@ -617,7 +617,7 @@ end
end
pos += 1
@eof
c = OrderedStructClosure(buf, pos, len, kw.data)
c = OrderedStructClosure(buf, pos, len, values(kw))
x = StructTypes.construct(c, T)
return c.pos, x

Expand Down
4 changes: 2 additions & 2 deletions src/write.jl
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ end
else
f.afterfirst = true
end
kw2 = merge(kw.data, f.kw)
kw2 = merge(values(kw), f.kw)
buf, pos, len = write(StringType(), buf, pos, len, nm; kw2...)
@writechar ':'
buf, pos, len = write(StructType(v), buf, pos, len, v; kw2...)
Expand All @@ -128,7 +128,7 @@ end
# generic object writing
@inline function write(::Union{Struct, Mutable}, buf, pos, len, x::T; kw...) where {T}
@writechar '{'
c = WriteClosure(buf, pos, len, false, kw.data)
c = WriteClosure(buf, pos, len, false, values(kw))
StructTypes.foreachfield(c, x)
buf = c.buf
pos = c.pos
Expand Down