From 20833c139cf7640387da8d95f6756f338d29ac5c Mon Sep 17 00:00:00 2001 From: John Firebaugh Date: Sat, 20 Apr 2013 16:33:04 -0700 Subject: [PATCH] Avoid _.bind Seeing some weird object retention behavior with it. --- js/id/core/graph.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/js/id/core/graph.js b/js/id/core/graph.js index 8fb54e914..8a493aaac 100644 --- a/js/id/core/graph.js +++ b/js/id/core/graph.js @@ -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) {