Permalink
Browse files

Merge pull request #7 from JeanSebTr/master

don't need to instantiate new objects to check their constructor
  • Loading branch information...
2 parents d744c66 + 761f6c8 commit 2dd9a354deec70c8fbabe4ee845b41dadfe6f9ad @kieran committed Mar 15, 2013
Showing with 3 additions and 3 deletions.
  1. +3 −3 lib/helpers.js
View
@@ -38,8 +38,8 @@ exports.regExpEscape = (function() {
exports.kindof = function(o) {
if (typeof(o) != "object") return typeof(o)
if (o === null) return "null"
- if (o.constructor == (new Array).constructor) return "array"
- if (o.constructor == (new Date).constructor) return "date"
- if (o.constructor == (new RegExp).constructor) return "regex"
+ if (o.constructor == Array) return "array"
+ if (o.constructor == Date) return "date"
+ if (o.constructor == RegExp) return "regex"
return "object"
}

0 comments on commit 2dd9a35

Please sign in to comment.