source: imaps-frontend/node_modules/globalthis/shim.js

main
Last change on this file was d565449, checked in by stefan toskovski <stefantoska84@…>, 4 weeks ago

Update repo after prototype presentation

  • Property mode set to 100644
File size: 715 bytes
Line 
1'use strict';
2
3var define = require('define-properties');
4var gOPD = require('gopd');
5var getPolyfill = require('./polyfill');
6
7module.exports = function shimGlobal() {
8 var polyfill = getPolyfill();
9 if (define.supportsDescriptors) {
10 var descriptor = gOPD(polyfill, 'globalThis');
11 if (
12 !descriptor
13 || (
14 descriptor.configurable
15 && (descriptor.enumerable || !descriptor.writable || globalThis !== polyfill)
16 )
17 ) {
18 Object.defineProperty(polyfill, 'globalThis', {
19 configurable: true,
20 enumerable: false,
21 value: polyfill,
22 writable: true
23 });
24 }
25 } else if (typeof globalThis !== 'object' || globalThis !== polyfill) {
26 polyfill.globalThis = polyfill;
27 }
28 return polyfill;
29};
Note: See TracBrowser for help on using the repository browser.