mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-16 11:42:04 +08:00
Refer to current _map, not most recent _map
This commit is contained in:
@ -15,16 +15,15 @@ export class Observable implements definition.Observable {
|
|||||||
constructor(json?: any) {
|
constructor(json?: any) {
|
||||||
if (json) {
|
if (json) {
|
||||||
this._map = new Map<string, Object>();
|
this._map = new Map<string, Object>();
|
||||||
var that = this;
|
|
||||||
|
|
||||||
var definePropertyFunc = function definePropertyFunc(propertyName) {
|
var definePropertyFunc = function definePropertyFunc(propertyName) {
|
||||||
Object.defineProperty(Observable.prototype, propertyName, {
|
Object.defineProperty(Observable.prototype, propertyName, {
|
||||||
get: function () {
|
get: function () {
|
||||||
return that._map.get(propertyName);
|
return this._map.get(propertyName);
|
||||||
},
|
},
|
||||||
set: function (value) {
|
set: function (value) {
|
||||||
that._map.set(propertyName, value);
|
this._map.set(propertyName, value);
|
||||||
that.notify(that._createPropertyChangeData(propertyName, value));
|
this.notify(this._createPropertyChangeData(propertyName, value));
|
||||||
},
|
},
|
||||||
enumerable: true,
|
enumerable: true,
|
||||||
configurable: true
|
configurable: true
|
||||||
|
Reference in New Issue
Block a user