Fixed #298: RangeError: Maximum call stack size exceeded with custom validator
This commit is contained in:
parent
3cdcdf57ce
commit
d6950885a1
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue