Skip to content

Commit

Permalink
Use globalThis as the global object if it exists
Browse files Browse the repository at this point in the history
  • Loading branch information
JakeChampion committed Aug 7, 2020
1 parent 3129f89 commit 96c2651
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
3 changes: 2 additions & 1 deletion .eslintrc.json
Expand Up @@ -8,7 +8,8 @@
"DataView": true,
"Promise": true,
"Symbol": true,
"Uint8Array": true
"Uint8Array": true,
"globalThis": true
},
"extends": [
"plugin:github/browser"
Expand Down
5 changes: 4 additions & 1 deletion fetch.js
@@ -1,4 +1,7 @@
var global = (typeof self !== 'undefined' && self) || (typeof global !== 'undefined' && global)
var global =
(typeof globalThis !== 'undefined' && globalThis) ||
(typeof self !== 'undefined' && self) ||
(typeof global !== 'undefined' && global)

var support = {
searchParams: 'URLSearchParams' in global,
Expand Down

1 comment on commit 96c2651

@Googlnew
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#1003 fetch.js

Please sign in to comment.