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…
Reference in New Issue