Refer to current _map, not most recent _map

This commit is contained in:
Joe D
2015-10-11 09:23:37 -04:00
committed by Rossen Hristov
parent ffa147fdeb
commit b2966f1fbd

View File

@ -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