UNPKG

630 BJavaScriptView Raw
1Object.defineProperty(exports, "__esModule", { value: true });
2var defaultFunctionName = '<anonymous>';
3/**
4 * Safely extract function name from itself
5 */
6function getFunctionName(fn) {
7 try {
8 if (!fn || typeof fn !== 'function') {
9 return defaultFunctionName;
10 }
11 return fn.name || defaultFunctionName;
12 }
13 catch (e) {
14 // Just accessing custom props in some Selenium environments
15 // can cause a "Permission denied" exception (see raven-js#495).
16 return defaultFunctionName;
17 }
18}
19exports.getFunctionName = getFunctionName;
20//# sourceMappingURL=stacktrace.js.map
\No newline at end of file