From f92daa8aeb228c5786c094342996491805e420ee Mon Sep 17 00:00:00 2001 From: Rob Rix Date: Wed, 21 Oct 2015 16:52:49 -0400 Subject: [PATCH] Recursive constructors close over a/b instead of passing them. --- prototype/UI/index.html | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/prototype/UI/index.html b/prototype/UI/index.html index 959fd6721..6cc6250d4 100644 --- a/prototype/UI/index.html +++ b/prototype/UI/index.html @@ -59,7 +59,7 @@ function Term(json, source) { this.range = json.extract; - this.syntax = syntax(json.unwrap, null, null, function(x) { return new Term(x, source); }); + this.syntax = syntax(json.unwrap, function(x) { return new Term(x, source); }); return this; } @@ -155,15 +155,15 @@ return this; } - function syntax(json, a, b, continuation) { - if (json instanceof Array) { return new Indexed(json, a, b, continuation); } - if (json instanceof Object) { return new Keyed(json, a, b, continuation); } - return new Leaf(json, a, b); + function syntax(json, continuation) { + if (json instanceof Array) { return new Indexed(json, continuation); } + if (json instanceof Object) { return new Keyed(json, continuation); } + return new Leaf(json); } function Diff(json, a, b) { if (json.pure != null) { this.pure = patch(json.pure, a, b); } - if (json.roll != null) { this.roll = syntax(json.roll, a, b, function(x, a, b) { return new Diff(x, a, b); }); } + if (json.roll != null) { this.roll = syntax(json.roll, function(x) { return new Diff(x, a, b); }); } return this; }