-
Notifications
You must be signed in to change notification settings - Fork 279
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use the third line instead of second
- Loading branch information
1 parent
7018b93
commit e2b1f19
Showing
2 changed files
with
6 additions
and
5 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -59,8 +59,8 @@ function getCallerLocation(stack?: string) { | |
// at filename.js:13:1 | ||
|
||
const lines = stack.split('\n') | ||
// Find the second line (caller of the current location) | ||
const callerLine = lines[2].trim() | ||
// Find the third line (caller's caller of the current location) | ||
const callerLine = lines[3].trim() | ||
|
||
const regex = | ||
/at\s+(?<functionName>.*?)\s+\((?<fileName>.*?):(?<lineNumber>\d+):(?<columnNumber>\d+)\)/ | ||
|
@@ -99,10 +99,11 @@ function getCallerLocation(stack?: string) { | |
// global [email protected]:13:4 | ||
|
||
const traces = stack.split('\n').map((line) => line.split('@')) | ||
const filtered = traces?.filter(([name, location]) => { | ||
const filtered = traces.filter(([name, location]) => { | ||
return name.length > 0 && location !== '[native code]' | ||
}) | ||
return filtered?.[1]?.filter((v) => v.length > 0).join('@') | ||
// Find the third line (caller's caller of the current location) | ||
return filtered[2].filter((v) => v.length > 0).join('@') | ||
} | ||
} | ||
|
||
|