Avoid _.bind

Seeing some weird object retention behavior with it.
This commit is contained in:
John Firebaugh
2013-04-20 16:33:04 -07:00
parent c60c21eb3a
commit 20833c139c
+2 -3
View File
@@ -24,7 +24,6 @@ iD.Graph = function(other, mutable) {
this.transients = {};
this._childNodes = {};
this.getEntity = _.bind(this.entity, this);
if (!mutable) {
this.freeze();
@@ -51,7 +50,7 @@ iD.Graph.prototype = {
},
parentWays: function(entity) {
return _.map(this._parentWays[entity.id], this.getEntity);
return _.map(this._parentWays[entity.id], this.entity, this);
},
isPoi: function(entity) {
@@ -65,7 +64,7 @@ iD.Graph.prototype = {
},
parentRelations: function(entity) {
return _.map(this._parentRels[entity.id], this.getEntity);
return _.map(this._parentRels[entity.id], this.entity, this);
},
childNodes: function(entity) {