Skip to content

Commit

Permalink
fixing undefined check
Browse files Browse the repository at this point in the history
  • Loading branch information
justinbmeyer committed Jun 2, 2018
1 parent 221c5f4 commit 56ae882
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
5 changes: 3 additions & 2 deletions reflections/type/type-test.js
Expand Up @@ -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(){
Expand Down
6 changes: 3 additions & 3 deletions reflections/type/type.js
Expand Up @@ -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
Expand All @@ -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) {
Expand Down

0 comments on commit 56ae882

Please sign in to comment.