UNPKG

725 BJavaScriptView Raw
1'use strict';
2var DESCRIPTORS = require('../internals/descriptors');
3var hasOwn = require('../internals/has-own-property');
4
5var FunctionPrototype = Function.prototype;
6// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
7var getDescriptor = DESCRIPTORS && Object.getOwnPropertyDescriptor;
8
9var EXISTS = hasOwn(FunctionPrototype, 'name');
10// additional protection from minified / mangled / dropped function names
11var PROPER = EXISTS && (function something() { /* empty */ }).name === 'something';
12var CONFIGURABLE = EXISTS && (!DESCRIPTORS || (DESCRIPTORS && getDescriptor(FunctionPrototype, 'name').configurable));
13
14module.exports = {
15 EXISTS: EXISTS,
16 PROPER: PROPER,
17 CONFIGURABLE: CONFIGURABLE
18};