From 6b78d5154f30ab3804e37f95f3e16bf024b5b078 Mon Sep 17 00:00:00 2001 From: Danny Yoo Date: Thu, 8 Sep 2011 14:48:08 -0400 Subject: [PATCH] fixed bug with insert-right that was causing broken invariant --- tests/more-tests/view.rkt | 34 +++++++++++++++++++--------------- web-world/js-impl.js | 2 -- web-world/js-tree-cursor.js | 2 +- 3 files changed, 20 insertions(+), 18 deletions(-) diff --git a/tests/more-tests/view.rkt b/tests/more-tests/view.rkt index 6cd9f7c..e8aad99 100644 --- a/tests/more-tests/view.rkt +++ b/tests/more-tests/view.rkt @@ -131,30 +131,34 @@ (view->xexp (view-insert-right - (view-down (view-focus (->view (xexp->dom '(html (head) - (body (h1 (@ (id "header"))) - (p (@ (id "para")) - (ul (li "one"))))))) - "para")) + (view-down + (view-down + (view-focus (->view (xexp->dom '(html (head) + (body (h1 (@ (id "header"))) + (p (@ (id "para")) + (ul (li "one"))))))) + "para"))) (xexp->dom '(li "two")))) (view->xexp (view-insert-right (view-insert-right - (view-down (view-focus (->view (xexp->dom '(html (head) - (body (h1 (@ (id "header"))) - (p (@ (id "para")) - (ul (li "one"))))))) - "para")) + (view-down + (view-down (view-focus (->view (xexp->dom '(html (head) + (body (h1 (@ (id "header"))) + (p (@ (id "para")) + (ul (li "one"))))))) + "para"))) (xexp->dom '(li "two"))) (xexp->dom '(li "three")))) (view->xexp (view-insert-left - (view-down (view-focus (->view (xexp->dom '(html (head) - (body (h1 (@ (id "header"))) - (p (@ (id "para")) - (ul (li "one"))))))) - "para")) + (view-down + (view-down (view-focus (->view (xexp->dom '(html (head) + (body (h1 (@ (id "header"))) + (p (@ (id "para")) + (ul (li "one"))))))) + "para"))) (xexp->dom '(li "zero")))) diff --git a/web-world/js-impl.js b/web-world/js-impl.js index 3c4c218..64a41de 100644 --- a/web-world/js-impl.js +++ b/web-world/js-impl.js @@ -235,8 +235,6 @@ MockView.prototype.updateCss = function(name, value) { return this.act( function(cursor) { - console.log($(cursor.node[0].cloneNode(false)) - .css(name, value).get(0)); return cursor.replaceNode([$(cursor.node[0].cloneNode(false)) .css(name, value).get(0)] .concat(cursor.node.slice(1))); diff --git a/web-world/js-tree-cursor.js b/web-world/js-tree-cursor.js index b928995..a9b59db 100644 --- a/web-world/js-tree-cursor.js +++ b/web-world/js-tree-cursor.js @@ -171,7 +171,7 @@ var TreeCursor = (function() { TreeCursor.prototype.insertRight = function(n) { return new TreeCursor(this.parent, n, - this.prevs.concat(this.node), + this.prevs.concat([this.node]), this.nexts, this.openF, this.closeF,