Merge branch 'master' of github.com:realm/realm-js into kneth/master-to-2.0.x

This commit is contained in:
Kenneth Geisshirt 2017-10-05 15:08:23 +02:00
commit dbfd3ce7d7
3 changed files with 16 additions and 15 deletions

View File

@ -1,20 +1,11 @@
<!--
Make sure to assign one and only one Type (`T:`) and State (`S:`) label.
Select reviewers if ready for review. Our bot will automatically assign you.
-->
<!-- Make sure to assign one and only one Type (`T:`) and State (`S:`) label.
Select reviewers if ready for review. Our bot will automatically assign you. -->
## What, How & Why?
<!-- Describe the changes and give some hints to guide your reviewers if possible. -->
<!-- E.g. reference to other repos: This closes realm/realm-sync#??? -->
<!--
Describe the changes and give some hints to guide your reviewers if possible.
-->
Reference to the issue(s) addressed by this PR: # ???
<!--
- This fixes #???
- This closes realm/realm-sync#???
-->
This closes # ???
## ☑️ ToDos
<!-- Add your own todos here -->

View File

@ -70,7 +70,7 @@
* Alignment of permission schemas.
* Updating sync (2.0.0-rc24).
1.13.0 Release notes (to be released)
1.13.0 Release notes (2017-10-5)
=============================================================
### Breaking changes
* None.

View File

@ -432,6 +432,16 @@ void RealmClass<T>::constructor(ContextType ctx, ObjectType this_object, size_t
config.schema_mode = SchemaMode::ResetFile;
}
static const String delete_realm_if_migration_needed_string = "deleteRealmIfMigrationNeeded";
ValueType delete_realm_if_migration_needed_value = Object::get_property(ctx, object, delete_realm_if_migration_needed_string);
if (!Value::is_undefined(ctx, delete_realm_if_migration_needed_value) && Value::validated_to_boolean(ctx, delete_realm_if_migration_needed_value, "deleteRealmIfMigrationNeeded")) {
if (config.schema_mode == SchemaMode::ReadOnly) {
throw std::invalid_argument("Cannot set 'deleteRealmIfMigrationNeeded' when 'readOnly' is set.");
}
config.schema_mode = SchemaMode::ResetFile;
}
static const String schema_string = "schema";
ValueType schema_value = Object::get_property(ctx, object, schema_string);
if (!Value::is_undefined(ctx, schema_value)) {