Fix the Node build.
Tweak the signature on some of the accessor methods to take `JSEngine::Value`s by value rather than by const reference. Some Node APIs appear to assume that only non-const objects will be used.
This commit is contained in:
parent
66da78af74
commit
75f8b28831
|
@ -70,7 +70,7 @@ public:
|
|||
}
|
||||
|
||||
template<typename T>
|
||||
T unbox(ValueType const& value, bool create = false, bool update = false);
|
||||
T unbox(ValueType value, bool create = false, bool update = false);
|
||||
|
||||
ValueType box(bool boolean) { return Value::from_boolean(m_ctx, boolean); }
|
||||
ValueType box(long long number) { return Value::from_number(m_ctx, number); }
|
||||
|
@ -193,7 +193,7 @@ struct Unbox<JSEngine, StringData> {
|
|||
// Need separate implementations per-engine
|
||||
template<typename JSEngine>
|
||||
struct Unbox<JSEngine, BinaryData> {
|
||||
static BinaryData call(NativeAccessor<JSEngine> *ctx, typename JSEngine::Value const& value, bool, bool);
|
||||
static BinaryData call(NativeAccessor<JSEngine> *ctx, typename JSEngine::Value value, bool, bool);
|
||||
};
|
||||
|
||||
template<typename JSEngine>
|
||||
|
@ -248,8 +248,8 @@ struct Unbox<JSEngine, RowExpr> {
|
|||
|
||||
template<typename T>
|
||||
template<typename U>
|
||||
U NativeAccessor<T>::unbox(ValueType const& value, bool create, bool update) {
|
||||
return _impl::Unbox<T, U>::call(this, value, create, update);
|
||||
U NativeAccessor<T>::unbox(ValueType value, bool create, bool update) {
|
||||
return _impl::Unbox<T, U>::call(this, std::move(value), create, update);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@ namespace js {
|
|||
|
||||
template<>
|
||||
template<>
|
||||
inline BinaryData NativeAccessor<jsc::Types>::unbox(ValueType const& value, bool, bool) {
|
||||
inline BinaryData NativeAccessor<jsc::Types>::unbox(ValueType value, bool, bool) {
|
||||
static jsc::String s_array_buffer = "ArrayBuffer";
|
||||
static jsc::String s_buffer = "buffer";
|
||||
static jsc::String s_byte_length = "byteLength";
|
||||
|
|
|
@ -28,7 +28,7 @@ namespace js {
|
|||
|
||||
template<>
|
||||
template<>
|
||||
inline BinaryData NativeAccessor<node::Types>::unbox(ValueType const& value, bool, bool) {
|
||||
inline BinaryData NativeAccessor<node::Types>::unbox(ValueType value, bool, bool) {
|
||||
if (Value::is_array_buffer(m_ctx, value)) {
|
||||
// TODO: This probably needs some abstraction for older V8.
|
||||
#if REALM_V8_ARRAY_BUFFER_API
|
||||
|
|
Loading…
Reference in New Issue