re-insert closure

This commit is contained in:
rolux 2012-05-25 21:13:11 +02:00
parent a956c8b7e1
commit f46ff46da8

View file

@ -341,31 +341,33 @@ Ox.typeOf = function(value) {
// Internet Explorer 8 returns 'Object' instead of 'NodeList', // Internet Explorer 8 returns 'Object' instead of 'NodeList',
// Internet Explorer 9 returns 'HTMLCollection' instead of 'NodeList', // Internet Explorer 9 returns 'HTMLCollection' instead of 'NodeList',
// Mobile Safari doesn't like null and undefined // Mobile Safari doesn't like null and undefined
if ( (function() {
Ox.typeOf(arguments) != 'arguments' if (
|| Ox.typeOf(document.getElementsByTagName('a')) != 'nodelist' Ox.typeOf(arguments) != 'arguments'
|| Ox.typeOf(null) != 'null' || Ox.typeOf(document.getElementsByTagName('a')) != 'nodelist'
|| Ox.typeOf() != 'undefined' || Ox.typeOf(null) != 'null'
) { || Ox.typeOf() != 'undefined'
Ox.typeOf = function(value) { ) {
var ret = Object.prototype.toString.call( Ox.typeOf = function(value) {
value var ret = Object.prototype.toString.call(
).slice(8, -1).toLowerCase(); value
if (typeof value.callee == 'function') { ).slice(8, -1).toLowerCase();
ret = 'arguments'; if (typeof value.callee == 'function') {
} else if ( ret = 'arguments';
ret == 'htmlcollection' || ( } else if (
ret == 'object' ret == 'htmlcollection' || (
&& typeof value.item != 'undefined' ret == 'object'
&& typeof value.length == 'number' && typeof value.item != 'undefined'
) && typeof value.length == 'number'
) { )
ret = 'nodelist'; ) {
} else if (value === null) { ret = 'nodelist';
ret = 'null'; } else if (value === null) {
} else if (value === void 0) { ret = 'null';
ret = 'undefined' } else if (value === void 0) {
} ret = 'undefined'
return ret; }
}; return ret;
} };
}
})();