Skip to content

Commit

Permalink
fix bug: classOf(null) and classOf(undefined) returns Object instead …
Browse files Browse the repository at this point in the history
…of null/undefined
  • Loading branch information
fbuecklers committed Dec 10, 2014
1 parent c01cb86 commit 5e894a6
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 6 deletions.
7 changes: 5 additions & 2 deletions jahcode.js
@@ -1,4 +1,4 @@
/*! Jahcode v1.1.4 | jahcode.com | Copyright 2011-2014 by Florian Buecklers | MIT license */
/*! Jahcode v1.1.5 | jahcode.com | Copyright 2011-2014 by Florian Buecklers | MIT license */

(function(global) {
var fakePrototype = Object.getPrototypeOf({
Expand Down Expand Up @@ -103,7 +103,7 @@
* @returns {boolean} <code>true</code> if the object is defined and
*/
isInstance : function(obj) {
if (obj === null || obj === undefined)
if (obj === null || obj === void 0)
return false;

return Object(obj) instanceof this || classOf(obj).linearizedTypes.lastIndexOf(this) != -1;
Expand Down Expand Up @@ -253,6 +253,9 @@
* @global
*/
var classOf = function(object) {
if (object === null || object === void 0)
return object;

return Object.getPrototypeOf(Object(object)).constructor;
};

Expand Down
2 changes: 1 addition & 1 deletion jahcode.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 5e894a6

Please sign in to comment.