diff --git a/lib/extensions.js b/lib/extensions.js index 999deeb9..d431c3ab 100644 --- a/lib/extensions.js +++ b/lib/extensions.js @@ -44,7 +44,7 @@ module.exports = function(realmConstructor) { Object.defineProperties(realmConstructor, getOwnPropertyDescriptors({ open(config) { return new Promise((resolve, reject) => { - const realm = new Realm(config); + const realm = new realmConstructor(config); realm.wait((error) => { if (error) { reject(new Error("Cannot asynchronously open synced Realm, because the associated session previously experienced a fatal error")); @@ -56,7 +56,7 @@ module.exports = function(realmConstructor) { }, openAsync(config, callback) { - const realm = new Realm(config); + const realm = new realmConstructor(config); realm.wait((error) => { if (error) { callback(new Error("Cannot asynchronously open synced Realm, because the associated session previously experienced a fatal error"));