Skip to content
This repository has been archived by the owner on Aug 11, 2021. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
Regression with 'entries' exposure
  • Loading branch information
isaacs committed Mar 26, 2012
1 parent 19d266d commit c40f023
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/dir-reader.js
Expand Up @@ -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)

Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit c40f023

Please sign in to comment.