* Creates a fake error stack, based on the current host environment. * * @param {...{ fn: string, file: string, line: number, col: number }} entries * An array of fake stack entries * * @returns {string}
(...entries)
| 13 | * @returns {string} |
| 14 | */ |
| 15 | function createFakeStack (...entries) { |
| 16 | let stack = ""; |
| 17 | |
| 18 | if (host.error.stack.includesErrorMessage) { |
| 19 | stack += "Error: This is a fake error\n"; |
| 20 | } |
| 21 | |
| 22 | for (let { fn, file, line, col } of entries) { |
| 23 | if (host.browser.firefox || host.browser.safari) { |
| 24 | stack += `${fn}@${file}:${line}:${col}\n`; |
| 25 | } |
| 26 | else { |
| 27 | stack += ` at ${fn} (${file}:${line}:${col})\n`; |
| 28 | } |
| 29 | } |
| 30 | |
| 31 | return stack; |
| 32 | } |
no outgoing calls
searching dependent graphs…