Skip to content

Commit

Permalink
Guard polyfills against window possibly being undefined (#7205)
Browse files Browse the repository at this point in the history
  • Loading branch information
jxom authored and ianschmitz committed Sep 24, 2019
1 parent 05f7924 commit b1e6155
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/react-app-polyfill/ie11.js
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion packages/react-app-polyfill/ie9.js
Expand Up @@ -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();

0 comments on commit b1e6155

Please sign in to comment.