diff --git a/reflections/type/type-test.js b/reflections/type/type-test.js index 468dd3f..a98d076 100644 --- a/reflections/type/type-test.js +++ b/reflections/type/type-test.js @@ -82,8 +82,9 @@ QUnit.test("isMapLike", function(){ QUnit.test("isMoreListLikeThanMapLike", function(){ QUnit.equal(typeReflections.isMoreListLikeThanMapLike({}), false, "Object"); QUnit.equal(typeReflections.isMoreListLikeThanMapLike([]), true, "Array"); - QUnit.equal(typeReflections.isMoreListLikeThanMapLike(undefined), "undefined", "undefined"); - QUnit.equal(typeReflections.isMoreListLikeThanMapLike(null), "undefined", "null"); + QUnit.equal(typeReflections.isMoreListLikeThanMapLike(null), false, "null"); + QUnit.equal(typeReflections.isMoreListLikeThanMapLike(undefined), false, "undefined"); + }); QUnit.test("isObservableLike", function(){ diff --git a/reflections/type/type.js b/reflections/type/type.js index 4de0017..268fdee 100644 --- a/reflections/type/type.js +++ b/reflections/type/type.js @@ -436,7 +436,7 @@ module.exports = { * * ``` * canReflect.isMoreListLikeThanMapLike([]); // -> true - * canReflect.isMoreListLikeThanMapLike(null); // -> undefined + * canReflect.isMoreListLikeThanMapLike(null); // -> false * canReflect.isMoreListLikeThanMapLike({}); // -> false * canReflect.isMoreListLikeThanMapLike(new DefineList()); // -> true * canReflect.isMoreListLikeThanMapLike(new DefineMap()); // -> false @@ -453,8 +453,8 @@ module.exports = { if(obj instanceof Array) { return true; } - if(obj === undefined || obj === null) { - return "undefined"; + if( obj == null ) { + return false; } var value = obj[canSymbol.for("can.isMoreListLikeThanMapLike")]; if(value !== undefined) {