UNPKG

470 BJavaScriptView Raw
1'use strict';
2var global = require('../internals/global');
3var DESCRIPTORS = require('../internals/descriptors');
4
5// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
6var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
7
8// Avoid NodeJS experimental warning
9module.exports = function (name) {
10 if (!DESCRIPTORS) return global[name];
11 var descriptor = getOwnPropertyDescriptor(global, name);
12 return descriptor && descriptor.value;
13};