Fix braindead coding error
authorAryeh Gregor <AryehGregor+gitcommit@gmail.com>
Wed, 09 Nov 2011 11:24:27 -0700
changeset 670 980710767f0e
parent 669 e524fb46434e
child 671 d062944c5b59
Fix braindead coding error

Didn't regenerate tests. Will do that for the next commit.
implementation.js
--- a/implementation.js	Wed Nov 09 10:58:32 2011 -0700
+++ b/implementation.js	Wed Nov 09 11:24:27 2011 -0700
@@ -4029,7 +4029,7 @@
 
 	// "If node has a child with index offset, and that child's length is not
 	// zero, return (that child, 0)."
-	if (0 <= node.childNodes.length
+	if (0 <= offset
 	&& offset < node.childNodes.length
 	&& getNodeLength(node.childNodes[offset]) != 0) {
 		return [node.childNodes[offset], 0];
@@ -4053,7 +4053,7 @@
 
 	// "If node has a child with index offset − 1, and that child's length is
 	// not zero, return (that child, that child's length)."
-	if (0 <= node.childNodes.length
+	if (0 <= offset - 1
 	&& offset - 1 < node.childNodes.length
 	&& getNodeLength(node.childNodes[offset - 1]) != 0) {
 		return [node.childNodes[offset - 1], getNodeLength(node.childNodes[offset - 1])];