From 7599a9f0168fc1ce39110cc20ce8e76cb3369115 Mon Sep 17 00:00:00 2001 From: Matt Zucker Date: Tue, 3 Jun 2025 19:10:39 -0400 Subject: [PATCH] handle optional parentheses in chrome's regex --- sourcemapped-stacktrace.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sourcemapped-stacktrace.js b/sourcemapped-stacktrace.js index 58f70ee..5c67a40 100644 --- a/sourcemapped-stacktrace.js +++ b/sourcemapped-stacktrace.js @@ -61,7 +61,7 @@ function(source_map_consumer) { } if (traceFormat === "chrome") { - regex = /^ +at.+\((.*):([0-9]+):([0-9]+)/; + regex = /^ +at.* +\(?(.*):([0-9]+):([0-9]+)/; expected_fields = 4; // (skip first line containing exception message) skip_lines = 1; @@ -249,7 +249,7 @@ function(source_map_consumer) { }; function origNameChrome(origLine) { - var match = / +at +([^ ]*).*/.exec(origLine); + var match = / +at +([^ ]*) +.*/.exec(origLine); return match && match[1]; }