]> git.ipfire.org Git - thirdparty/moment.git/commitdiff
Fix isObject in IE8
authorIskren Chernev <iskren.chernev@gmail.com>
Mon, 12 Sep 2016 06:51:31 +0000 (23:51 -0700)
committerIskren Chernev <iskren.chernev@gmail.com>
Mon, 12 Sep 2016 06:51:31 +0000 (23:51 -0700)
src/lib/utils/is-object.js

index 6018e12de0f17d6219c849ed269382cd1c14dc18..111353899ac92a7010237cb84e8bdae2b3e72b60 100644 (file)
@@ -1,3 +1,5 @@
 export default function isObject(input) {
-    return Object.prototype.toString.call(input) === '[object Object]';
+    // IE8 will treat undefined and null as object if it wasn't for
+    // input != null
+    return input != null && Object.prototype.toString.call(input) === '[object Object]';
 }