From 55a4f0c6150c8d679518867c66e297a2e450073d Mon Sep 17 00:00:00 2001 From: Tony Garnock-Jones Date: Sat, 26 Oct 2013 18:36:58 +0100 Subject: [PATCH] Fix bug: no need to propagate routing changes back down again --- index.js | 18 ++++++++++++++++++ marketplace.js | 2 +- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index 3ab16e0..0fe1453 100644 --- a/index.js +++ b/index.js @@ -60,6 +60,24 @@ var g = new Ground(function () { sub(__, 1)]); World.send({msg: 'hello outer world'}, 1); World.send({msg: 'hello inner world'}, 0); + // World.spawn(new World(function () { + // World.spawn({ + // boot: function () { + // console.log('w1p1'); + // World.updateRoutes([sub('w1p1')]); + // }, + // handleEvent: function (e) { console.log('w1p1', e); } + // }) + // })) + // World.spawn(new World(function () { + // World.spawn({ + // boot: function () { + // console.log('w2p2'); + // World.updateRoutes([sub('w2p2')]); + // }, + // handleEvent: function (e) { console.log('w2p2', e); } + // }) + // })); }, handleEvent: function (e) { if (e.type === "send" && e.message[0] === "jQuery") { diff --git a/marketplace.js b/marketplace.js index e141955..8ddc200 100644 --- a/marketplace.js +++ b/marketplace.js @@ -391,7 +391,7 @@ World.prototype.handleEvent = function (e) { switch (e.type) { case "routes": this.downwardRoutes = liftRoutes(e.routes); - this.issueRoutingUpdate(); + this.eventQueue.push(updateRoutes(this.aggregateRoutes(this.downwardRoutes))); break; case "send": this.eventQueue.push(sendMessage(e.message, e.metaLevel + 1, e.isFeedback));