Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

Commit

Permalink
util: strip out unwanted properties before _extend
Browse files Browse the repository at this point in the history
  • Loading branch information
Evan Lucas committed Sep 2, 2014
1 parent e9a2558 commit ef7439c
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions lib/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -744,17 +744,16 @@ exports._errnoException = function(err, syscall, original, additions) {
e.errno = errname;
e.syscall = syscall;
if (additions && isObject(additions)) {
var add = exports._extend(e, additions);
var keys = Object.keys(add);
var i = keys.length;
while (i--) {
var key = keys[i];
var val = add[key];
if (isNullOrUndefined(val) || isFunction(val)) {
delete add[key];
var keys = Object.keys(additions);
var len = keys.length;
for (var i = 0; i < len; i++) {
if (isNullOrUndefined(keys[i]) || isFunction(keys[i])) {
delete additions[keys[i]];
keys.splice(i, 1);
i--;
}
}
e = add;
exports._extend(e, additions);
}
return e;
};

0 comments on commit ef7439c

Please sign in to comment.