Initial commit
[yaffs-website] / node_modules / grunt-contrib-watch / node_modules / lodash / internal / getFuncName.js
1 var realNames = require('./realNames');
2
3 /**
4  * Gets the name of `func`.
5  *
6  * @private
7  * @param {Function} func The function to query.
8  * @returns {string} Returns the function name.
9  */
10 function getFuncName(func) {
11   var result = (func.name + ''),
12       array = realNames[result],
13       length = array ? array.length : 0;
14
15   while (length--) {
16     var data = array[length],
17         otherFunc = data.func;
18     if (otherFunc == null || otherFunc == func) {
19       return data.name;
20     }
21   }
22   return result;
23 }
24
25 module.exports = getFuncName;