Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exclude Error constructor from stack trace #1217

Merged

Conversation

resnickj
Copy link
Contributor

@resnickj resnickj commented Jul 2, 2022

When an error is explicitly thrown from a script, it does make sense to include the Error constructor itself in the captured stack trace. The trace should begin at the point where the Error object is constructed.

Changes:

  • If the current function on the call stack is the Error constructor function, exclude it from the captured stack trace.
  • Fix issues with reported location so that JavaScriptException.Location is consistent with the location recorded in the stack trace.
  • Add new test, adjust existing tests

* If the current function on the call stack is the Error constructor function, exclude it from the captured stack trace.
* Fix issues with reported location so that JavaScriptException.Location is consistent with the location recorded in the stack trace.
* add new test, adjust existing tests
Copy link
Collaborator

@lahma lahma left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice improvement, the change makes sense 👍🏻

@lahma lahma merged commit 110ea56 into sebastienros:main Jul 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants