From 9e65aafde1519ac6e4420c06f499456563e93443 Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Sun, 6 Mar 2011 23:46:11 -0700 Subject: [PATCH] fixed bug when Array.prototype is extended --- lib/remedial.js | 6 ++++-- package.json | 12 ------------ 2 files changed, 4 insertions(+), 14 deletions(-) delete mode 100644 package.json diff --git a/lib/remedial.js b/lib/remedial.js index 4561bfd..9fba228 100644 --- a/lib/remedial.js +++ b/lib/remedial.js @@ -8,8 +8,10 @@ class2type = {}; for (i in classes) { - name = classes[i]; - class2type["[object " + name + "]"] = name.toLowerCase(); + if (classes.hasOwnProperty(i)) { + name = classes[i]; + class2type["[object " + name + "]"] = name.toLowerCase(); + } } function typeOf(obj) { diff --git a/package.json b/package.json deleted file mode 100644 index 3dad8d1..0000000 --- a/package.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "name" : "remedial", - "description" : "Douglas Crockford's Remedial JavaScript", - "url" : "http://javascript.crockford.com/remedial.html", - "keywords" : ["util", "isEmpty", "typeOf", "entityify", "quote", "supplant", "trim"], - "author" : "Douglas Crockford ", - "contributors" : [], - "dependencies" : [], - "lib" : "lib", - "main" : "./lib/remedial", - "version" : "1.0.4" -}