Skip to content

Commit

Permalink
Add globalThis check to the globalThis ponyfill (#16)
Browse files Browse the repository at this point in the history
  • Loading branch information
chocolateboy authored Aug 12, 2020
1 parent 57ce6aa commit 43895e0
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions browser.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
/* eslint-env browser */
/* global globalThis:readonly */
'use strict';

// Ponyfill for `globalThis`
const _globalThis = (() => {
if (typeof globalThis !== 'undefined') {
return globalThis;
}

if (typeof self !== 'undefined') {
return self;
}
Expand Down

0 comments on commit 43895e0

Please sign in to comment.