Remove observablePropertyCounter to help avoid accumulating garbage on prop redefinition

This commit is contained in:
Tony Garnock-Jones 2016-08-07 11:31:51 -04:00
parent f3631ed18f
commit e2575c3ea1
1 changed files with 1 additions and 2 deletions

View File

@ -10,7 +10,6 @@ function Graph() {
this.damagedNodes = Immutable.Set();
this.currentSubjectId = null;
this.enforceSubjectPresence = true;
this.observablePropertyCounter = 0;
}
Graph.prototype.withSubject = function (subjectId, f) {
@ -81,7 +80,7 @@ Graph.prototype.repairDamage = function (repairNode) {
Graph.prototype.defineObservableProperty = function (obj, prop, value, maybeOptions) {
var graph = this;
var options = typeof maybeOptions === 'undefined' ? {} : maybeOptions;
var objectId = '__' + (options.baseId || prop) + '_' + (graph.observablePropertyCounter++);
var objectId = '__' + (options.baseId || prop);
Object.defineProperty(obj, prop, {
configurable: true,
enumerable: true,