Skip to content

Commit 800945c

Browse files
committed
style: automatic fixes for new ESLint rules
Signed-off-by: Kevin Locke <kevin@kevinlocke.name>
1 parent fd38339 commit 800945c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

index.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,16 @@ function mochaHooks() {
2222
process.on('unhandledRejection', (reason) => {
2323
throw reason;
2424
});
25-
} else if (typeof window !== 'undefined') {
25+
} else if (typeof globalThis !== 'undefined') {
2626
// Note: This event may be emitted natively or by promise libraries
2727
// (e.g. bluebird and when.js)
2828
if (typeof window.addEventListener === 'function') {
29-
window.addEventListener('unhandledrejection', (evt) => {
29+
globalThis.addEventListener('unhandledrejection', (evt) => {
3030
throw evt.detail.reason;
3131
});
3232
} else {
33-
const oldOHR = window.onunhandledrejection;
34-
window.onunhandledrejection = function(evt, ...args) {
33+
const oldOHR = globalThis.onunhandledrejection;
34+
globalThis.onunhandledrejection = function(evt, ...args) {
3535
if (typeof oldOHR === 'function') { oldOHR.apply(this, args); }
3636
throw evt.detail.reason;
3737
};

0 commit comments

Comments
 (0)