Permalink
Browse files

Regression with 'entries' exposure

  • Loading branch information...
1 parent 19d266d commit c40f02311015d56ef2809a2a5a40fcfdf4190a7d @isaacs isaacs committed Mar 26, 2012
Showing with 5 additions and 1 deletion.
  1. +5 −1 lib/dir-reader.js
View
6 lib/dir-reader.js
@@ -11,6 +11,7 @@ var fs = require("graceful-fs")
, mkdir = require("mkdirp")
, path = require("path")
, Reader = require("./reader.js")
+ , assert = require("assert").ok
inherits(DirReader, Reader)
@@ -44,7 +45,7 @@ DirReader.prototype._getEntries = function () {
else processEntries()
function processEntries () {
- me._length = entries.length
+ me._length = me.entries.length
// console.error("DR %s sort =", me.path, me.props.sort)
if (typeof me.props.sort === "function") {
me.entries.sort(me.props.sort)
@@ -79,6 +80,9 @@ DirReader.prototype._read = function () {
// save creating a proxy, by stat'ing the thing now.
var p = path.resolve(me._path, me.entries[me._index])
+ assert(p !== me._path)
+ assert(me.entries[me._index])
+
// set this to prevent trying to _read() again in the stat time.
me._currentEntry = p
fs[ me.props.follow ? "stat" : "lstat" ](p, function (er, stat) {

0 comments on commit c40f023

Please sign in to comment.