1234567891011121314151617181920212223242526272829303132333435 |
- var naiveFallback = function () {
- if (typeof self === "object" && self) return self;
- if (typeof window === "object" && window) return window;
- throw new Error("Unable to resolve global `this`");
- };
- module.exports = (function () {
- if (this) return this;
-
-
- if (typeof globalThis === "object" && globalThis) return globalThis;
-
-
-
- try {
- Object.defineProperty(Object.prototype, "__global__", {
- get: function () { return this; },
- configurable: true
- });
- } catch (error) {
-
-
- return naiveFallback();
- }
- try {
-
- if (!__global__) return naiveFallback();
- return __global__;
- } finally {
- delete Object.prototype.__global__;
- }
- })();
|