Guard polyfills against window possibly being undefined (#7205)

This commit is contained in:
Jake Moxey
2019-09-24 13:44:45 +10:00
committed by Ian Schmitz
parent 05f7924398
commit b1e6155c02
2 changed files with 3 additions and 2 deletions

View File

@@ -11,7 +11,7 @@ if (typeof Promise === 'undefined') {
// inconsistent state due to an error, but it gets swallowed by a Promise,
// and the user has no idea what causes React's erratic future behavior.
require('promise/lib/rejection-tracking').enable();
window.Promise = require('promise/lib/es6-extensions.js');
self.Promise = require('promise/lib/es6-extensions.js');
}
// Make sure we're in a Browser-like environment before importing polyfills

View File

@@ -11,4 +11,5 @@ require('./ie11');
// React 16+ relies on Map, Set, and requestAnimationFrame
require('core-js/features/map');
require('core-js/features/set');
require('raf').polyfill(window);
require('raf').polyfill();