Fixed #298: RangeError: Maximum call stack size exceeded with custom validator

This commit is contained in:
Semigradsky 2016-07-05 11:36:06 +03:00
parent 3cdcdf57ce
commit d6950885a1
2 changed files with 6 additions and 0 deletions

View File

@ -32,6 +32,8 @@ module.exports = {
return false;
} else if (Array.isArray(a)) {
return !this.arraysDiffer(a, b);
} else if (typeof a === 'function') {
return a.toString() === b.toString();
} else if (typeof a === 'object' && a !== null && b !== null) {
return !this.objectsDiffer(a, b);
}

View File

@ -25,6 +25,10 @@ export default {
test.equal(utils.isSame(objA, objH), false);
test.equal(utils.isSame(objG, objA), false);
test.equal(utils.isSame(() => {}, () => {}), true);
test.equal(utils.isSame(objA, () => {}), false);
test.equal(utils.isSame(() => {}, objA), false);
test.done();
}