Convert some more camelCase in js_realm.hpp

This commit is contained in:
Scott Kyle 2016-04-18 12:07:36 -07:00
parent 5c56a99403
commit 49e2b54151
1 changed files with 18 additions and 18 deletions

View File

@ -259,32 +259,32 @@ void Realm<T>::constructor(TContext ctx, TObject this_object, size_t argc, const
else if (Value::is_object(ctx, value)) { else if (Value::is_object(ctx, value)) {
TObject object = Value::validated_to_object(ctx, value); TObject object = Value::validated_to_object(ctx, value);
TValue pathValue = Object::get_property(ctx, object, path_string); TValue path_value = Object::get_property(ctx, object, path_string);
if (!Value::is_undefined(ctx, pathValue)) { if (!Value::is_undefined(ctx, path_value)) {
config.path = Value::validated_to_string(ctx, pathValue, "path"); config.path = Value::validated_to_string(ctx, path_value, "path");
} }
else { else {
config.path = js::default_path(); config.path = js::default_path();
} }
TValue schemaValue = Object::get_property(ctx, object, schema_string); TValue schema_value = Object::get_property(ctx, object, schema_string);
if (!Value::is_undefined(ctx, schemaValue)) { if (!Value::is_undefined(ctx, schema_value)) {
TObject schemaObject = Value::validated_to_object(ctx, schemaValue, "schema"); TObject schema_object = Value::validated_to_object(ctx, schema_value, "schema");
config.schema.reset(new realm::Schema(Schema<T>::parse_schema(ctx, schemaObject, defaults, constructors))); config.schema.reset(new realm::Schema(Schema<T>::parse_schema(ctx, schema_object, defaults, constructors)));
} }
TValue versionValue = Object::get_property(ctx, object, schema_version_string); TValue version_value = Object::get_property(ctx, object, schema_version_string);
if (!Value::is_undefined(ctx, versionValue)) { if (!Value::is_undefined(ctx, version_value)) {
config.schema_version = Value::validated_to_number(ctx, versionValue, "schemaVersion"); config.schema_version = Value::validated_to_number(ctx, version_value, "schemaVersion");
} }
else { else {
config.schema_version = 0; config.schema_version = 0;
} }
TValue encryptionKeyValue = Object::get_property(ctx, object, encryption_key_string); TValue encryption_key_value = Object::get_property(ctx, object, encryption_key_string);
if (!Value::is_undefined(ctx, encryptionKeyValue)) { if (!Value::is_undefined(ctx, encryption_key_value)) {
std::string encryptionKey = NativeAccessor::to_binary(ctx, encryptionKeyValue); std::string encryption_key = NativeAccessor::to_binary(ctx, encryption_key_value);
config.encryption_key = std::vector<char>(encryptionKey.begin(), encryptionKey.end()); config.encryption_key = std::vector<char>(encryption_key.begin(), encryption_key.end());
} }
} }
} }
@ -371,9 +371,9 @@ template<typename T>
void Realm<T>::create(TContext ctx, TObject this_object, size_t argc, const TValue arguments[], ReturnValue &return_value) { void Realm<T>::create(TContext ctx, TObject this_object, size_t argc, const TValue arguments[], ReturnValue &return_value) {
validate_argument_count(argc, 2, 3); validate_argument_count(argc, 2, 3);
SharedRealm sharedRealm = *get_internal<T, RealmClass<T>>(this_object); SharedRealm realm = *get_internal<T, RealmClass<T>>(this_object);
std::string className = validated_object_type_for_value(sharedRealm, ctx, arguments[0]); std::string className = validated_object_type_for_value(realm, ctx, arguments[0]);
auto &schema = sharedRealm->config().schema; auto &schema = realm->config().schema;
auto object_schema = schema->find(className); auto object_schema = schema->find(className);
if (object_schema == schema->end()) { if (object_schema == schema->end()) {
@ -390,7 +390,7 @@ void Realm<T>::create(TContext ctx, TObject this_object, size_t argc, const TVal
update = Value::validated_to_boolean(ctx, arguments[2], "update"); update = Value::validated_to_boolean(ctx, arguments[2], "update");
} }
auto realm_object = realm::Object::create<TValue>(ctx, sharedRealm, *object_schema, object, update); auto realm_object = realm::Object::create<TValue>(ctx, realm, *object_schema, object, update);
return_value.set(RealmObject<T>::create_instance(ctx, realm_object)); return_value.set(RealmObject<T>::create_instance(ctx, realm_object));
} }