mirror of
https://github.com/status-im/realm-js.git
synced 2025-02-02 17:53:55 +00:00
Fix Object.setPrototypeOf issue on Android (#1195)
* Fix Object.setPrototypeOf issue on Android * Fix prototype chain
This commit is contained in:
parent
ee3b855efb
commit
bb3411f7f7
@ -44,8 +44,15 @@ PersonObject.prototype.description = function() {
|
||||
PersonObject.prototype.toString = function() {
|
||||
return this.name;
|
||||
};
|
||||
Object.setPrototypeOf(PersonObject, Realm.Object);
|
||||
Object.setPrototypeOf(PersonObject.prototype, Realm.Object.prototype);
|
||||
|
||||
// Object.setPrototypeOf doesn't work on JSC on Android. The code below achieves the same thing.
|
||||
//Object.setPrototypeOf(PersonObject, Realm.Object);
|
||||
//Object.setPrototypeOf(PersonObject.prototype, Realm.Object.prototype);
|
||||
|
||||
PersonObject.__proto__ = Realm.Object;
|
||||
PersonObject.prototype.__proto__ = Realm.Object.prototype;
|
||||
|
||||
|
||||
exports.PersonObject = PersonObject;
|
||||
|
||||
exports.PersonList = {
|
||||
|
Loading…
x
Reference in New Issue
Block a user