(stackString: string, options?: ParseOptions)
| 28 | const frames: StackFrame[] = []; |
| 29 | for (const rawLine of lines) { |
| 30 | if (/^\s*at\s+/.test(rawLine)) { |
| 31 | if (CHROME_IE_STACK_REGEXP.test(rawLine)) frames.push(parseV8Line(rawLine)); |
| 32 | } else if (/^\s*in\s+/.test(rawLine)) { |
| 33 | const elementName = rawLine |
| 34 | .replace(/^\s*in\s+/, "") |
| 35 | .replace(/\s*(?:\(at .*\)|\[[^\]]+\])$/, ""); |
| 36 | frames.push({ functionName: elementName, source: rawLine }); |
| 37 | } else if (rawLine.match(FIREFOX_SAFARI_STACK_REGEXP)) { |
| 38 | if (!SAFARI_NATIVE_CODE_REGEXP.test(rawLine)) frames.push(parseSafariLine(rawLine)); |
| 39 | } |
| 40 | } |
| 41 | return frames; |
| 42 | } |
| 43 | if (stackString.match(CHROME_IE_STACK_REGEXP)) { |
| 44 | return parseV8OrIeString(stackString); |
| 45 | } |
| 46 | return parseFFOrSafariString(stackString); |
| 47 | }; |
| 48 | |
| 49 | const getPositionIndex = (location: string, endIndex: number): number => { |
| 50 | let positionIndex = endIndex - 1; |
| 51 | while (positionIndex >= 0) { |
| 52 | const character = location.charCodeAt(positionIndex); |
| 53 | if (character < 48 || character > 57) break; |
| 54 | positionIndex--; |
| 55 | } |
no test coverage detected
searching dependent graphs…