Skip to content

Commit

Permalink
Fixed #298: RangeError: Maximum call stack size exceeded with custom …
Browse files Browse the repository at this point in the history
…validator
  • Loading branch information
Semigradsky committed Jul 5, 2016
1 parent 3cdcdf5 commit d695088
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
4 changes: 4 additions & 0 deletions tests/Utils-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();

}
Expand Down

0 comments on commit d695088

Please sign in to comment.