Skip to content

Commit

Permalink
Add new dist
Browse files Browse the repository at this point in the history
  • Loading branch information
taylorhakes committed Oct 22, 2021
1 parent 2078b34 commit a78ac02
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
17 changes: 11 additions & 6 deletions dist/polyfill.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ function allSettled(arr) {
// Store setTimeout reference so promise-polyfill will be unaffected by
// other code modifying setTimeout (like sinon.useFakeTimers())
var setTimeoutFunc = setTimeout;
// @ts-ignore
var setImmediateFunc = typeof setImmediate !== 'undefined' ? setImmediate : null;

function isArray(x) {
return Boolean(x && typeof x.length !== 'undefined');
Expand Down Expand Up @@ -310,10 +312,10 @@ Promise.race = function(arr) {
// Use polyfill for setImmediate for performance gains
Promise._immediateFn =
// @ts-ignore
(typeof setImmediate === 'function' &&
(typeof setImmediateFunc === 'function' &&
function(fn) {
// @ts-ignore
setImmediate(fn);
setImmediateFunc(fn);
}) ||
function(fn) {
setTimeoutFunc(fn, 0);
Expand Down Expand Up @@ -348,10 +350,13 @@ var globalNS = (function() {
// https://github.com/taylorhakes/promise-polyfill/issues/114
if (typeof globalNS['Promise'] !== 'function') {
globalNS['Promise'] = Promise;
} else if (!globalNS.Promise.prototype['finally']) {
globalNS.Promise.prototype['finally'] = finallyConstructor;
} else if (!globalNS.Promise.allSettled) {
globalNS.Promise.allSettled = allSettled;
} else {
if (!globalNS.Promise.prototype['finally']) {
globalNS.Promise.prototype['finally'] = finallyConstructor;
}
if (!globalNS.Promise.allSettled) {
globalNS.Promise.allSettled = allSettled;
}
}

})));
2 changes: 1 addition & 1 deletion dist/polyfill.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit a78ac02

Please sign in to comment.