Ensure unknown objectTypes return false.

Former-commit-id: a60236ecd8908a91c0268d71d5710665986f1ceb
This commit is contained in:
John-David Dalton
2013-05-05 23:49:37 -07:00
parent 8781053dbe
commit 4cc3fcb6e8

View File

@@ -1810,7 +1810,7 @@
// http://es5.github.com/#x8
// and avoid a V8 bug
// http://code.google.com/p/v8/issues/detail?id=2291
return value ? objectTypes[typeof value] : false;
return !!(value && objectTypes[typeof value]);
}
/**
@@ -1931,7 +1931,7 @@
* // => true
*/
function isRegExp(value) {
return value ? (objectTypes[typeof value] && toString.call(value) == regexpClass) : false;
return !!(value && objectTypes[typeof value]) && toString.call(value) == regexpClass);
}
/**