From 5f3025d1afdbecdcba78a5b9ea374c8ac1e2ccd2 Mon Sep 17 00:00:00 2001 From: Curtis Vogt Date: Wed, 24 Jan 2018 08:53:50 -0600 Subject: [PATCH] Compat for Serialization stdlib --- README.md | 4 ++++ src/Compat.jl | 6 ++++++ test/runtests.jl | 8 ++++++++ 3 files changed, 18 insertions(+) diff --git a/README.md b/README.md index f2dba8404..6b11e010e 100644 --- a/README.md +++ b/README.md @@ -122,6 +122,9 @@ Currently, the `@compat` macro supports the following syntaxes: * `using Compat.REPL` is provided on versions older than 0.7, where this library is not yet part of the standard library ([#25544]). +* `using Compat.Serialization` is provided on versions older than 0.7, where this library is + not yet part of the standard library ([#25628]). + ## New functions, macros, and methods * `@views` takes an expression and converts all slices to views ([#20164]), while @@ -493,5 +496,6 @@ includes this fix. Find the minimum version from there. [#25544]: https://github.com/JuliaLang/julia/issues/25544 [#25545]: https://github.com/JuliaLang/julia/issues/25545 [#25571]: https://github.com/JuliaLang/julia/issues/25571 +[#25628]: https://github.com/JuliaLang/julia/issues/25628 [#25629]: https://github.com/JuliaLang/julia/issues/25629 [#25654]: https://github.com/JuliaLang/julia/issues/25654 diff --git a/src/Compat.jl b/src/Compat.jl index 2b110b2c4..8c1efcb17 100644 --- a/src/Compat.jl +++ b/src/Compat.jl @@ -837,6 +837,12 @@ else import REPL end +if VERSION < v"0.7.0-DEV.3476" + const Serialization = Base.Serializer +else + import Serialization +end + # 0.7.0-DEV.1993 @static if !isdefined(Base, :EqualTo) if VERSION >= v"0.6.0" diff --git a/test/runtests.jl b/test/runtests.jl index 494d86332..4944682d4 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -1190,6 +1190,14 @@ module TestREPL @test isdefined(@__MODULE__, :REPL) end +# 0.7.0-DEV.3476 +module TestSerialization + using Compat + using Compat.Serialization + using Compat.Test + @test isdefined(@__MODULE__, :Serialization) +end + if VERSION < v"0.6.0" include("deprecated.jl") end