File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -22,16 +22,16 @@ function mochaHooks() {
22
22
process . on ( 'unhandledRejection' , ( reason ) => {
23
23
throw reason ;
24
24
} ) ;
25
- } else if ( typeof window !== 'undefined' ) {
25
+ } else if ( typeof globalThis !== 'undefined' ) {
26
26
// Note: This event may be emitted natively or by promise libraries
27
27
// (e.g. bluebird and when.js)
28
28
if ( typeof window . addEventListener === 'function' ) {
29
- window . addEventListener ( 'unhandledrejection' , ( evt ) => {
29
+ globalThis . addEventListener ( 'unhandledrejection' , ( evt ) => {
30
30
throw evt . detail . reason ;
31
31
} ) ;
32
32
} else {
33
- const oldOHR = window . onunhandledrejection ;
34
- window . onunhandledrejection = function ( evt , ...args ) {
33
+ const oldOHR = globalThis . onunhandledrejection ;
34
+ globalThis . onunhandledrejection = function ( evt , ...args ) {
35
35
if ( typeof oldOHR === 'function' ) { oldOHR . apply ( this , args ) ; }
36
36
throw evt . detail . reason ;
37
37
} ;
You can’t perform that action at this time.
0 commit comments