mirror of
https://github.com/status-im/realm-js.git
synced 2025-02-20 02:18:26 +00:00
Use int64_t
rather than long long
as the integer type in the accessor
implementation. This matches what core uses for integers, and avoids ambiguity that otherwise results when `int64_t` is declared as `long` rather than `long long`.
This commit is contained in:
parent
75f8b28831
commit
b108d06231
@ -73,7 +73,7 @@ public:
|
|||||||
T unbox(ValueType 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(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(float number) { return Value::from_number(m_ctx, number); }
|
||||||
ValueType box(double 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()); }
|
ValueType box(StringData string) { return Value::from_string(m_ctx, string.data()); }
|
||||||
@ -134,8 +134,8 @@ struct Unbox<JSEngine, bool> {
|
|||||||
};
|
};
|
||||||
|
|
||||||
template<typename JSEngine>
|
template<typename JSEngine>
|
||||||
struct Unbox<JSEngine, long long> {
|
struct Unbox<JSEngine, int64_t> {
|
||||||
static long long call(NativeAccessor<JSEngine> *ctx, typename JSEngine::Value const& value, bool, bool) {
|
static int64_t call(NativeAccessor<JSEngine> *ctx, typename JSEngine::Value const& value, bool, bool) {
|
||||||
return js::Value<JSEngine>::validated_to_number(ctx->m_ctx, value, "Property");
|
return js::Value<JSEngine>::validated_to_number(ctx->m_ctx, value, "Property");
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -162,8 +162,8 @@ struct Unbox<JSEngine, util::Optional<bool>> {
|
|||||||
};
|
};
|
||||||
|
|
||||||
template<typename JSEngine>
|
template<typename JSEngine>
|
||||||
struct Unbox<JSEngine, util::Optional<long long>> {
|
struct Unbox<JSEngine, util::Optional<int64_t>> {
|
||||||
static util::Optional<long long> call(NativeAccessor<JSEngine> *ctx, typename JSEngine::Value const& value, bool, bool) {
|
static util::Optional<int64_t> call(NativeAccessor<JSEngine> *ctx, typename JSEngine::Value const& value, bool, bool) {
|
||||||
return js::Value<JSEngine>::validated_to_number(ctx->m_ctx, value, "Property");
|
return js::Value<JSEngine>::validated_to_number(ctx->m_ctx, value, "Property");
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user