fix Ox.checkType

This commit is contained in:
rolux 2012-05-19 12:48:01 +04:00
parent 5692195509
commit 8479037ab6

View file

@ -4,10 +4,10 @@
Ox.checkType <f> Throws a TypeError if a value is not of a given type
(val, type) -> <u> undefined
val <*> Any value
type <s> Type
type <s|[s]> Type, or array of types
@*/
Ox.checkType = function(val, type) {
if (!Ox.in(Ox.toArray(type), Ox.typeOf(val))) {
if (!Ox.in(Ox.makeArray(type), Ox.typeOf(val))) {
throw new TypeError();
}
};