From 540c7687092939342265bd6d5c1ee45173bfc48b Mon Sep 17 00:00:00 2001 From: Sonny Piers Date: Fri, 26 Feb 2021 13:30:07 +0100 Subject: [PATCH] polyfill: add support for globalThis --- polyfill.js | 1 + polyfill.mjs | 1 + 2 files changed, 2 insertions(+) diff --git a/polyfill.js b/polyfill.js index 3ca8923..5d31048 100644 --- a/polyfill.js +++ b/polyfill.js @@ -6,6 +6,7 @@ const ac = require("./dist/abort-controller") /*eslint-disable @mysticatea/prettier */ const g = typeof self !== "undefined" ? self : + typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : /* otherwise */ undefined diff --git a/polyfill.mjs b/polyfill.mjs index 0602a64..2a1a9d2 100644 --- a/polyfill.mjs +++ b/polyfill.mjs @@ -4,6 +4,7 @@ import * as ac from "./dist/abort-controller" /*eslint-disable @mysticatea/prettier */ const g = typeof self !== "undefined" ? self : + typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : /* otherwise */ undefined