Skip to content

Commit b1e6155

Browse files
jxomianschmitz
authored andcommitted
Guard polyfills against window possibly being undefined (#7205)
1 parent 05f7924 commit b1e6155

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

packages/react-app-polyfill/ie11.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ if (typeof Promise === 'undefined') {
1111
// inconsistent state due to an error, but it gets swallowed by a Promise,
1212
// and the user has no idea what causes React's erratic future behavior.
1313
require('promise/lib/rejection-tracking').enable();
14-
window.Promise = require('promise/lib/es6-extensions.js');
14+
self.Promise = require('promise/lib/es6-extensions.js');
1515
}
1616

1717
// Make sure we're in a Browser-like environment before importing polyfills

packages/react-app-polyfill/ie9.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,5 @@ require('./ie11');
1111
// React 16+ relies on Map, Set, and requestAnimationFrame
1212
require('core-js/features/map');
1313
require('core-js/features/set');
14-
require('raf').polyfill(window);
14+
15+
require('raf').polyfill();

0 commit comments

Comments
 (0)