diff --git a/lib/objects.js b/lib/objects.js index 190d401f..135005b6 100644 --- a/lib/objects.js +++ b/lib/objects.js @@ -24,9 +24,7 @@ function create(realmId, info) { object[keys.id] = info.id; object[keys.type] = info.type; - schema.properties.forEach((prop) => { - let name = prop.name; - + schema.properties.forEach((name) => { Object.defineProperty(object, name, { enumerable: true, get: util.getterForProperty(name), diff --git a/src/rpc.cpp b/src/rpc.cpp index ba7d5a7e..c7c024c5 100644 --- a/src/rpc.cpp +++ b/src/rpc.cpp @@ -289,12 +289,10 @@ json RPCServer::serialize_json_value(JSValueRef value) { } json RPCServer::serialize_object_schema(const realm::ObjectSchema &object_schema) { - json properties = json::array(); + std::vector properties; + for (realm::Property prop : object_schema.properties) { - properties.push_back({ - {"name", prop.name}, - {"type", RJSTypeGet(prop.type)}, - }); + properties.push_back(prop.name); } return {