summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--js/lib/node.js12
1 files changed, 6 insertions, 6 deletions
diff --git a/js/lib/node.js b/js/lib/node.js
index c90c3e9..9fc71c7 100644
--- a/js/lib/node.js
+++ b/js/lib/node.js
@@ -27,7 +27,7 @@ var next = function(){
var cur = this.current;
var entering = this.entering;
- if (!cur) {
+ if (cur === null) {
return null;
}
@@ -42,13 +42,13 @@ var next = function(){
this.entering = false;
}
- } else if (cur.next) {
- this.current = cur.next;
- this.entering = true;
-
- } else {
+ } else if (cur.next === null) {
this.current = cur.parent;
this.entering = false;
+
+ } else {
+ this.current = cur.next;
+ this.entering = true;
}
return {entering: entering, node: cur};