(name: string)
| 18 | let prefix; |
| 19 | let suffix; |
| 20 | export function describeBuiltInComponentFrame(name: string): string { |
| 21 | if (prefix === undefined) { |
| 22 | // Extract the VM specific prefix used by each line. |
| 23 | try { |
| 24 | throw Error(); |
| 25 | } catch (x) { |
| 26 | const match = x.stack.trim().match(/\n( *(at )?)/); |
| 27 | prefix = (match && match[1]) || ''; |
| 28 | suffix = |
| 29 | x.stack.indexOf('\n at') > -1 |
| 30 | ? // V8 |
| 31 | ' (<anonymous>)' |
| 32 | : // JSC/Spidermonkey |
| 33 | x.stack.indexOf('@') > -1 |
| 34 | ? '@unknown:0:0' |
| 35 | : // Other |
| 36 | ''; |
| 37 | } |
| 38 | } |
| 39 | // We use the prefix to ensure our stacks line up with native stack frames. |
| 40 | return '\n' + prefix + name + suffix; |
| 41 | } |
| 42 | |
| 43 | export function describeDebugInfoFrame( |
| 44 | name: string, |
no outgoing calls
no test coverage detected