Skip to content

Commit

Permalink
added undefined and null support fixes #105
Browse files Browse the repository at this point in the history
  • Loading branch information
Aosanders committed Jun 2, 2018
1 parent ca389b5 commit 9ebeadf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions reflections/type/type-test.js
Expand Up @@ -82,6 +82,8 @@ 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.test("isObservableLike", function(){
Expand Down
3 changes: 3 additions & 0 deletions reflections/type/type.js
Expand Up @@ -453,6 +453,9 @@ module.exports = {
if(obj instanceof Array) {
return true;
}
if(obj === undefined || obj === null) {
return "undefined";
}
var value = obj[canSymbol.for("can.isMoreListLikeThanMapLike")];
if(value !== undefined) {
return value;
Expand Down

0 comments on commit 9ebeadf

Please sign in to comment.