From 319373525dc4603346661641840cd9a3e0613136 Mon Sep 17 00:00:00 2001 From: Jordan Harband Date: Mon, 12 Sep 2022 16:51:07 -0700 Subject: [PATCH] [Fix] properly recognize `document.all` in Safari 4 --- index.js | 2 +- test/index.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/index.js b/index.js index e758666..aa47f30 100644 --- a/index.js +++ b/index.js @@ -51,7 +51,7 @@ var isDDA = typeof document === 'object' ? function isDocumentDotAll(value) { // in IE 8, typeof document.all is "object" if (typeof value === 'undefined' || typeof value === 'object') { try { - return value('') === null; + return value('') == null; // eslint-disable-line eqeqeq } catch (e) { /**/ } } return false; diff --git a/test/index.js b/test/index.js index 1061af7..5ae4890 100644 --- a/test/index.js +++ b/test/index.js @@ -179,9 +179,9 @@ test('DOM', function (t) { var constructor = global[name]; t.test(name, { skip: !constructor }, function (st) { - st.match(typeof constructor, /^(?:function|object)$/, name + ' is a function'); + st.match(typeof constructor, /^(?:function|object)$/, name + ' is a function or object'); - st.equal(isCallable(constructor), !isIE68, name + ' is ' + (isIE68 ? 'not ' : '') + 'callable'); + st.equal(isCallable(constructor), typeof constructor === 'function', name + ' is ' + (isIE68 ? 'not ' : '') + 'callable'); st.end(); });