Permalink
Browse files

Abstract out the emitChild method

  • Loading branch information...
1 parent 34cdcea commit 6439e4c5ec209e6b5eb3e3a5ae6b4bafacc5df25 @isaacs isaacs committed Mar 27, 2012
Showing with 6 additions and 2 deletions.
  1. +6 −2 lib/dir-reader.js
View
@@ -144,8 +144,7 @@ DirReader.prototype._read = function () {
if (entry.type === "Socket") {
me.emit("socket", entry)
} else {
- me.emit("entry", entry)
- me.emit("child", entry)
+ me.emitEntry(entry)
}
})
@@ -235,3 +234,8 @@ DirReader.prototype.resume = function (who) {
}
} else me._read()
}
+
+DirReader.prototype.emitEntry = function (entry) {
+ this.emit("entry", entry)
+ this.emit("child", entry)
+}

0 comments on commit 6439e4c

Please sign in to comment.