Skip to content
This repository was archived by the owner on Sep 21, 2021. It is now read-only.

Commit be49ea1

Browse files
committed
Add comment for Regex
1 parent 261cf26 commit be49ea1

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

packages/devtools-reps/src/reps/error.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,13 @@ function getStacktraceElements(preview) {
8989
return;
9090
}
9191

92-
const result = line.match(/^(.*)@(.*)$/);
9392
let functionName;
9493
let location;
94+
95+
// Given the input: "functionName@scriptLocation:2:100"
96+
// Result:
97+
// ["functionName@scriptLocation:2:100", "functionName", "scriptLocation:2:100"]
98+
const result = line.match(/^(.*)@(.*)$/);
9599
if (result && result.length === 3) {
96100
functionName = result[1];
97101

0 commit comments

Comments
 (0)