diff --git a/src/index.jst b/src/index.jst index 5d4ee2f..cb0035d 100644 --- a/src/index.jst +++ b/src/index.jst @@ -48,8 +48,8 @@ module.exports = function equal(a, b) { {{?}} if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags; - if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf(); - if (a.toString !== Object.prototype.toString) return a.toString() === b.toString(); + if (a.valueOf !== Object.prototype.valueOf && a.valueOf) return a.valueOf() === b.valueOf(); + if (a.toString !== Object.prototype.toString && a.toString) return a.toString() === b.toString(); keys = Object.keys(a); length = keys.length;