(fn: unknown)
| 131 | * Safely extract function name from itself |
| 132 | */ |
| 133 | export function getFunctionName(fn: unknown): string { |
| 134 | try { |
| 135 | if (!fn || typeof fn !== 'function') { |
| 136 | return defaultFunctionName; |
| 137 | } |
| 138 | return fn.name || defaultFunctionName; |
| 139 | } catch { |
| 140 | // Just accessing custom props in some Selenium environments |
| 141 | // can cause a "Permission denied" exception (see raven-js#495). |
| 142 | return defaultFunctionName; |
| 143 | } |
| 144 | } |
| 145 | |
| 146 | /** |
| 147 | * Get's stack frames from an event without needing to check for undefined properties. |
no outgoing calls
no test coverage detected