Skip to content

Commit d59a812

Browse files
committed
ref(utils): add stripSentryFramesAndReverse comment
1 parent d0cafb5 commit d59a812

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

packages/utils/src/stacktrace.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,9 @@ export function stackParserFromStackParserOptions(stackParser: StackParser | Sta
5555
}
5656

5757
/**
58+
* Removes Sentry frames from the top and bottom of the stack if present and enforces a limit of max number of frames.
59+
* Assumes stack input is ordered from top to bottom and returns the reverse representation so call site of the
60+
* function that caused the crash is the last frame in the array.
5861
* @hidden
5962
*/
6063
export function stripSentryFramesAndReverse(stack: ReadonlyArray<StackFrame>): StackFrame[] {
@@ -79,7 +82,6 @@ export function stripSentryFramesAndReverse(stack: ReadonlyArray<StackFrame>): S
7982
localStack.pop();
8083
}
8184

82-
// The frame where the crash happened, should be the last entry in the array
8385
return localStack.map(frame => ({
8486
...frame,
8587
filename: frame.filename || localStack[0].filename,

0 commit comments

Comments
 (0)