Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Call filters properly in the face of _proxy streams

  • Loading branch information...
commit cfd1a634b6d84552d227012f8e22f42579602f89 1 parent 76cd33c
@isaacs isaacs authored
Showing with 4 additions and 2 deletions.
  1. +2 −1  lib/reader.js
  2. +2 −1  lib/writer.js
View
3  lib/reader.js
@@ -187,8 +187,9 @@ Reader.prototype._stat = function (currentStat) {
// if the filter doesn't pass, then just skip over this one.
// still have to emit end so that dir-walking can move on.
if (me.filter) {
+ var who = me._proxy || me
// special handling for ProxyReaders
- if (!me.filter.call(me._proxy || me)) {
+ if (!me.filter.call(who, who, props)) {
me._aborted = true
me.emit("end")
me.emit("close")
View
3  lib/writer.js
@@ -123,12 +123,13 @@ Writer.prototype._stat = function (current) {
var me = this
, props = me.props
, stat = props.follow ? "stat" : "lstat"
+ , who = me._proxy || me
if (current) statCb(null, current)
else fs[stat](me._path, statCb)
function statCb (er, current) {
- if (me.filter && !me.filter.call(me._proxy || me, current)) {
+ if (me.filter && !me.filter.call(who, who, current)) {
me._aborted = true
me.emit("end")
me.emit("close")
Please sign in to comment.
Something went wrong with that request. Please try again.