Skip to content

Commit

Permalink
[fix] Clone enumerable AND non-enumerable Error properties when cloning.
Browse files Browse the repository at this point in the history
  • Loading branch information
indexzero committed Oct 29, 2015
1 parent ec8afd5 commit 73890ac
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/winston/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,9 @@ exports.clone = function (obj) {
// With potential custom Error objects, this might not be exactly correct,
// but probably close-enough for purposes of this lib.
copy = new Error(obj.message);
for (var i in obj) {
copy[i] = obj[i];
}
Object.getOwnPropertyNames(obj).forEach(function (key) {
copy[key] = obj[key];
});

return copy;
}
Expand Down

0 comments on commit 73890ac

Please sign in to comment.