From d9f204cf45f792c4337a45e2f97e244cedade8ba Mon Sep 17 00:00:00 2001 From: Bryan Housel Date: Wed, 7 Jan 2015 11:51:55 -0500 Subject: [PATCH] Remove Graph#freeze --- js/id/core/graph.js | 10 ++-------- test/spec/core/graph.js | 8 +------- 2 files changed, 3 insertions(+), 15 deletions(-) diff --git a/js/id/core/graph.js b/js/id/core/graph.js index 8a514b21e..d641b064c 100644 --- a/js/id/core/graph.js +++ b/js/id/core/graph.js @@ -258,15 +258,9 @@ iD.Graph.prototype = { arguments[i].call(graph, graph); } - return this.frozen ? graph.freeze() : this; - }, + if (this.frozen) graph.frozen = true; - freeze: function() { - this.frozen = true; - - // No longer freezing entities here due to in-place updates needed in rebase. - - return this; + return graph; }, // Obliterates any existing entities diff --git a/test/spec/core/graph.js b/test/spec/core/graph.js index db8934631..4bd7aeb7d 100644 --- a/test/spec/core/graph.js +++ b/test/spec/core/graph.js @@ -30,7 +30,7 @@ describe('iD.Graph', function() { }); it("remains mutable if passed true as second argument", function () { - expect(iD.Graph([], true).frozen).not.to.be.true; + expect(iD.Graph([], true).frozen).to.be.false; }); }); @@ -58,12 +58,6 @@ describe('iD.Graph', function() { }); }); - describe("#freeze", function () { - it("sets the frozen flag", function () { - expect(iD.Graph([], true).freeze().frozen).to.be.true; - }); - }); - describe("#rebase", function () { it("preserves existing entities", function () { var node = iD.Node({id: 'n'}),