First Push
This commit is contained in:
22
node_modules/globalthis/shim.js
generated
vendored
Normal file
22
node_modules/globalthis/shim.js
generated
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
'use strict';
|
||||
|
||||
var define = require('define-properties');
|
||||
var getPolyfill = require('./polyfill');
|
||||
|
||||
module.exports = function shimGlobal() {
|
||||
var polyfill = getPolyfill();
|
||||
if (define.supportsDescriptors) {
|
||||
var descriptor = Object.getOwnPropertyDescriptor(polyfill, 'globalThis');
|
||||
if (!descriptor || (descriptor.configurable && (descriptor.enumerable || !descriptor.writable || globalThis !== polyfill))) { // eslint-disable-line max-len
|
||||
Object.defineProperty(polyfill, 'globalThis', {
|
||||
configurable: true,
|
||||
enumerable: false,
|
||||
value: polyfill,
|
||||
writable: true
|
||||
});
|
||||
}
|
||||
} else if (typeof globalThis !== 'object' || globalThis !== polyfill) {
|
||||
polyfill.globalThis = polyfill;
|
||||
}
|
||||
return polyfill;
|
||||
};
|
||||
Reference in New Issue
Block a user