From 6ef716aed7d5c5a7c1a8d5fd43f659961d019d14 Mon Sep 17 00:00:00 2001 From: Alex Arslan Date: Wed, 13 Dec 2017 22:16:05 -0800 Subject: [PATCH] Fix for Base Unicode functions moving to stdlib (#229) --- src/Common.jl | 5 +++++ src/Writer.jl | 4 ++++ src/bytes.jl | 2 +- 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/Common.jl b/src/Common.jl index 65fd062..0e85706 100644 --- a/src/Common.jl +++ b/src/Common.jl @@ -3,6 +3,11 @@ Internal implementation detail. """ module Common +using Compat +if VERSION >= v"0.7.0-DEV.2915" + using Unicode +end + include("bytes.jl") include("errors.jl") diff --git a/src/Writer.jl b/src/Writer.jl index 9c00c90..68d1043 100644 --- a/src/Writer.jl +++ b/src/Writer.jl @@ -6,6 +6,10 @@ using ..Common using ..Serializations: Serialization, StandardSerialization, CommonSerialization +if VERSION >= v"0.7.0-DEV.2915" + using Unicode +end + """ Internal JSON.jl implementation detail; do not depend on this type. diff --git a/src/bytes.jl b/src/bytes.jl index 0a41eed..048c6da 100644 --- a/src/bytes.jl +++ b/src/bytes.jl @@ -44,7 +44,7 @@ const ESCAPES = Dict( LATIN_T => TAB) const REVERSE_ESCAPES = Dict(reverse(p) for p in ESCAPES) -const ESCAPED_ARRAY = Vector{Vector{UInt8}}(256) +const ESCAPED_ARRAY = Vector{Vector{UInt8}}(uninitialized, 256) for c in 0x00:0xFF ESCAPED_ARRAY[c + 1] = if c == SOLIDUS [SOLIDUS] # don't escape this one