From 140599968faae2bcfa9f547426ae3d84766cb08d Mon Sep 17 00:00:00 2001 From: Ari Lazier Date: Thu, 4 Aug 2016 11:11:46 -0700 Subject: [PATCH] copy assignment operator --- src/jsc/jsc_protected.hpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/jsc/jsc_protected.hpp b/src/jsc/jsc_protected.hpp index 34ac870f..07229f9b 100644 --- a/src/jsc/jsc_protected.hpp +++ b/src/jsc/jsc_protected.hpp @@ -90,6 +90,12 @@ class Protected { return JSValueIsStrictEqual(a.m_context, a.m_value, b.m_value); } }; + + Protected& operator=(Protected other) { + std::swap(m_context, other.m_context); + std::swap(m_value, other.m_value); + return *this; + } }; template<> @@ -104,6 +110,11 @@ class Protected : public Protected { JSValueRef value = static_cast(*this); return (JSObjectRef)value; } + + Protected& operator=(Protected other) { + std::swap(*this, other); + return *this; + } }; } // js