Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Convention

  • Loading branch information...
commit 7e061bad0b45e92edd95eb02e430705a37b93723 1 parent 7364e2f
@StevenLooman authored
Showing with 5 additions and 2 deletions.
  1. +5 −2 lib/state.js
View
7 lib/state.js
@@ -37,8 +37,7 @@ State.prototype.matches = function(node, depth) {
match = match && this.matchesPredicate(node);
}
if (match && this.axis === 'child') {
-// console.log('child', depth, this.enteredDepth + 1);
- match = match && depth === this.enteredDepth + 1;
+ match = match && this.matchesDepth(depth);
}
if (match) {
console.log('match');
@@ -54,6 +53,10 @@ State.prototype.unmatches = function(tag, depth) {
return unmatch;
};
+State.prototype.matchesDepth = function(depth) {
+ return depth === this.enteredDepth + 1;
+};
+
State.prototype.matchesName = function(node) {
return node.name === this.name;
};
Please sign in to comment.
Something went wrong with that request. Please try again.