UNPKG

501 BJavaScriptView Raw
1import Promise from './index';
2
3var global = (function() {
4 // the only reliable means to get the global object is
5 // `Function('return this')()`
6 // However, this causes CSP violations in Chrome apps.
7 if (typeof self !== 'undefined') {
8 return self;
9 }
10 if (typeof window !== 'undefined') {
11 return window;
12 }
13 if (typeof global !== 'undefined') {
14 return global;
15 }
16 throw new Error('unable to locate global object');
17})();
18
19if (!global.Promise) {
20 global.Promise = Promise;
21}