Comparing version 1.1.0 to 1.1.1
@@ -42,3 +42,3 @@ 'use strict'; | ||
if (props) for (var prop in props) { | ||
if (!(prop in err) && props.hasOwnProperty(prop)) { | ||
if (!(prop in err) && has.call(props, prop)) { | ||
err[prop] = props[prop]; | ||
@@ -45,0 +45,0 @@ } |
{ | ||
"name": "failure", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"description": "Easily generate \"custom\" error objects with addition properties which can be stringfied with JSON.stringify", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
13
test.js
@@ -25,2 +25,15 @@ describe('failure', function () { | ||
it('accepts Object.create(null)', function () { | ||
var obj = Object.create(null) | ||
, err; | ||
obj.foo = 'bar'; | ||
obj.message = 'hi'; | ||
err = failure(new Error('what'), obj); | ||
assume(err.message).equals('what'); | ||
assume(err.foo).equals('bar'); | ||
}); | ||
describe('#toJSON', function () { | ||
@@ -27,0 +40,0 @@ it('adds the `toJSON` function', function () { |
9562
108