artdaq_node_server  v1_00_08
 All Classes Namespaces Files Variables Pages
_getFuncName.js
1 var realNames = require('./_realNames');
2 
4 var objectProto = Object.prototype;
5 
7 var hasOwnProperty = objectProto.hasOwnProperty;
8 
16 function getFuncName(func) {
17  var result = (func.name + ''),
18  array = realNames[result],
19  length = hasOwnProperty.call(realNames, result) ? array.length : 0;
20 
21  while (length--) {
22  var data = array[length],
23  otherFunc = data.func;
24  if (otherFunc == null || otherFunc == func) {
25  return data.name;
26  }
27  }
28  return result;
29 }
30 
31 module.exports = getFuncName;