Skip to content

Commit

Permalink
Merge branch 'master' of github.com:realm/realm-js
Browse files Browse the repository at this point in the history
  • Loading branch information
kneth committed Nov 11, 2021
2 parents f469e3e + 4bff22d commit 4002ab7
Showing 1 changed file with 0 additions and 56 deletions.
56 changes: 0 additions & 56 deletions src/js_types.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -196,62 +196,6 @@ struct Value {
static OwnedBinaryData to_binary(ContextType, const ValueType&);
static bson::Bson to_bson(ContextType, ValueType);
static Mixed to_mixed(ContextType ctx, std::shared_ptr<Realm> realm, const ValueType& value, std::string &string_buffer);
// {
// if (is_null(ctx, value) || is_undefined(ctx, value)) {
// return Mixed(realm::null());
// }
// else if (is_boolean(ctx, value)) {
// return Mixed(to_boolean(ctx, value));
// }
// else if (is_date(ctx, value)) {
// auto date = to_date(ctx, value);

// double milliseconds = to_number(ctx, date);
// int64_t seconds = milliseconds / 1000;
// int32_t nanoseconds = ((int64_t)milliseconds % 1000) * 1000000;
// Timestamp ts(seconds, nanoseconds);

// return Mixed(ts);
// }
// else if (is_number(ctx, value)) {
// return Mixed(to_number(ctx, value));
// }
// else if (is_string(ctx, value)) {
// string_buffer = std::move(to_string(ctx, value));
// return Mixed(string_buffer);
// }
// else if (is_binary(ctx, value)) {
// return Mixed(to_binary(ctx, value).get());
// }
// else if (is_decimal128(ctx, value)) {
// return Mixed(to_decimal128(ctx, value));
// }
// else if (is_object_id(ctx, value)) {
// return Mixed(to_object_id(ctx, value));
// }
// else if (is_uuid(ctx, value)) {
// return Mixed(to_uuid(ctx, value));
// }
// else if (is_array(ctx, value)) {
// throw std::runtime_error("A mixed property cannot contain an array of values.");
// }
// else if (is_object(ctx, value)) {
// const std::string message = "Only Realm instances are supported.";
// auto js_object = to_object(ctx, value);

// auto is_ros_instance = Object<T>::template is_instance<RealmObjectClass<T>>(ctx, js_object);
// if (!is_ros_instance) {
// throw std::runtime_error(message);
// }
// auto os_object = Object<T>::template get_internal<RealmObjectClass<T>>(ctx, js_object);
// if (!(os_object && os_object->realm() == realm)) {
// throw std::runtime_error(message);
// }

// return Mixed(os_object->obj());
// }
// REALM_UNREACHABLE();
// }

#define VALIDATED(return_t, type) \
static return_t validated_to_##type(ContextType ctx, const ValueType &value, const char *name = nullptr) { \
Expand Down

0 comments on commit 4002ab7

Please sign in to comment.