From: Iskren Chernev Date: Mon, 12 Sep 2016 06:51:31 +0000 (-0700) Subject: Fix isObject in IE8 X-Git-Tag: 2.15.0~3^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=504d957d282dd477735f54d30073b5bcfcdca67d;p=thirdparty%2Fmoment.git Fix isObject in IE8 --- diff --git a/src/lib/utils/is-object.js b/src/lib/utils/is-object.js index 6018e12de..111353899 100644 --- a/src/lib/utils/is-object.js +++ b/src/lib/utils/is-object.js @@ -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]'; }