MCPcopy Index your code
hub / github.com/nodejs/node / getFunctionName

Function getFunctionName

test/fixtures/snapshot/typescript.js:2817–2829  ·  view source on GitHub ↗
(func)

Source from the content-addressed store, hash-verified

2815 function type(_value) { }
2816 Debug.type = type;
2817 function getFunctionName(func) {
2818 if (typeof func !== "function") {
2819 return "";
2820 }
2821 else if (func.hasOwnProperty("name")) {
2822 return func.name;
2823 }
2824 else {
2825 var text = Function.prototype.toString.call(func);
2826 var match = /^function\s+([\w\$]+)\s*\(/.exec(text);
2827 return match ? match[1] : "";
2828 }
2829 }
2830 Debug.getFunctionName = getFunctionName;
2831 function formatSymbol(symbol) {
2832 return "{ name: ".concat(ts.unescapeLeadingUnderscores(symbol.escapedName), "; flags: ").concat(formatSymbolFlags(symbol.flags), "; declarations: ").concat(ts.map(symbol.declarations, function (node) { return formatSyntaxKind(node.kind); }), " }");

Callers 5

assertEachNodeFunction · 0.85
assertNodeFunction · 0.85
assertNotNodeFunction · 0.85
assertOptionalNodeFunction · 0.85
deprecateFunction · 0.85

Calls 3

hasOwnPropertyMethod · 0.45
callMethod · 0.45
execMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…