expose promise polyfill in a way that won't need code migration later
This commit is contained in:
parent
62724a1143
commit
439cf95673
7 changed files with 60 additions and 95 deletions
|
|
@ -95,4 +95,9 @@ PromisePolyfill.race = function(list) {
|
|||
})
|
||||
}
|
||||
|
||||
module.exports = typeof Promise !== "undefined" ? Promise : PromisePolyfill
|
||||
if (typeof Promise === "undefined") {
|
||||
if (typeof window !== "undefined") window.Promise = PromisePolyfill
|
||||
else if (typeof global !== "undefined") global.Promise = PromisePolyfill
|
||||
}
|
||||
|
||||
module.exports = typeof Promise !== "undefined" ? Promise : PromisePolyfill
|
||||
Loading…
Add table
Add a link
Reference in a new issue