| 311 | } |
| 312 | |
| 313 | function cleanFunctionName(fn) { |
| 314 | let s = String(fn).trim(); |
| 315 | |
| 316 | if (!s) return "<anonymous>"; |
| 317 | if (s === "<anonymous>") return s; |
| 318 | |
| 319 | return s |
| 320 | .replace(/^async\*/, "async ") |
| 321 | .replace(/^setTimeout handler\*/, "timer ") |
| 322 | .replace(/^promise callback\*/, "promise ") |
| 323 | .replace(/\["#-[^"]+"\]/g, "[userscript]") |
| 324 | .replace(/\/</g, " › ") |
| 325 | .replace(/>+/g, "") |
| 326 | .replace(/\s+/g, " ") |
| 327 | .trim() || "<anonymous>"; |
| 328 | } |
| 329 | |
| 330 | function cleanFileName(file, options) { |
| 331 | let s = String(file); |