diff --git a/lib/core/public/run.js b/lib/core/public/run.js index 1389734b91..3575f9a27d 100644 --- a/lib/core/public/run.js +++ b/lib/core/public/run.js @@ -105,7 +105,7 @@ axe.run = function (context, options, callback) { let reject = noop; let resolve = noop; - if (window.Promise && callback === noop) { + if (typeof Promise === 'function' && callback === noop) { p = new Promise(function (_resolve, _reject) { reject = _reject; resolve = _resolve; @@ -143,4 +143,4 @@ axe.run = function (context, options, callback) { }); return p; -}; \ No newline at end of file +};