Skip to content

Commit

Permalink
fixed the tests for how typeof a regex is now "object"
Browse files Browse the repository at this point in the history
  • Loading branch information
James Halliday committed Apr 7, 2012
1 parent 2c5f693 commit 9250084
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 3 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module.exports = function (obj) {
var traverse = module.exports = function (obj) {
return new Traverse(obj);
};

Expand Down Expand Up @@ -273,9 +273,9 @@ var forEach = function (xs, fn) {
};

forEach(Object_keys(Traverse.prototype), function (key) {
Traverse[key] = function (obj) {
traverse[key] = function (obj) {
var args = [].slice.call(arguments, 1);
var t = Traverse(obj);
var t = new Traverse(obj);
return t[key].apply(t, args);
};
});
4 changes: 4 additions & 0 deletions test/lib/deep_equal.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@ module.exports = function (a, b) {
notEqual();
}
}
else if (toS(y) === '[object RegExp]'
|| toS(x) === '[object RegExp]') {
if (!x || !y || x.toString() !== y.toString()) notEqual();
}
else if (x instanceof Date || y instanceof Date) {
if (!(x instanceof Date) || !(y instanceof Date)
|| x.getTime() !== y.getTime()) {
Expand Down

0 comments on commit 9250084

Please sign in to comment.