1 var baseProperty = require('./baseProperty'),
2 constant = require('../utility/constant'),
3 realNames = require('./realNames'),
4 support = require('../support');
7 * Gets the name of `func`.
10 * @param {Function} func The function to query.
11 * @returns {string} Returns the function name.
13 var getFuncName = (function() {
14 if (!support.funcNames) {
17 if (constant.name == 'constant') {
18 return baseProperty('name');
20 return function(func) {
21 var result = func.name,
22 array = realNames[result],
23 length = array ? array.length : 0;
26 var data = array[length],
27 otherFunc = data.func;
29 if (otherFunc == null || otherFunc == func) {
37 module.exports = getFuncName;