diff --git a/src/js_object_accessor.hpp b/src/js_object_accessor.hpp index fe73d83e..6fb3b043 100644 --- a/src/js_object_accessor.hpp +++ b/src/js_object_accessor.hpp @@ -73,7 +73,7 @@ public: 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); } + ValueType box(int64_t number) { return Value::from_number(m_ctx, number); } ValueType box(float number) { return Value::from_number(m_ctx, number); } ValueType box(double number) { return Value::from_number(m_ctx, number); } ValueType box(StringData string) { return Value::from_string(m_ctx, string.data()); } @@ -134,8 +134,8 @@ struct Unbox { }; template -struct Unbox { - static long long call(NativeAccessor *ctx, typename JSEngine::Value const& value, bool, bool) { +struct Unbox { + static int64_t call(NativeAccessor *ctx, typename JSEngine::Value const& value, bool, bool) { return js::Value::validated_to_number(ctx->m_ctx, value, "Property"); } }; @@ -162,8 +162,8 @@ struct Unbox> { }; template -struct Unbox> { - static util::Optional call(NativeAccessor *ctx, typename JSEngine::Value const& value, bool, bool) { +struct Unbox> { + static util::Optional call(NativeAccessor *ctx, typename JSEngine::Value const& value, bool, bool) { return js::Value::validated_to_number(ctx->m_ctx, value, "Property"); } };