-
Notifications
You must be signed in to change notification settings - Fork 119
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
Allow iterating over the frames of a CapturedJSStack #539
Conversation
Signed-off-by: Simon Wülker <[email protected]>
7962318
to
c36406a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
Could you add a test in https://github.com/servo/mozjs/blob/main/mozjs/tests/capture_stack.rs ? |
Signed-off-by: Simon Wülker <[email protected]>
Done. Should I create a new release for mozjs or is it fine to pin the git commit in servo? |
Fixed by moving the test into its own file. |
This prevents other tests from interfering with the js engine initialization Signed-off-by: Simon Wülker <[email protected]>
9613463
to
4f80640
Compare
Since this PR only modifies Rust code, we can just update the git revision. C++ changes need a version number update to ensure new static library binaries are published. |
This adds
CapturedJSStack::for_each_stack_frame
which calls the provided closure for each element in the linked list ofSavedFrame
s. Unfortunately, I don't think there's an easy way to make this an iterator overSavedFrame
s, because of the lifetime associated with aRootedGuard
.for_each_stack_frame
is useful for providing js backtraces in functions likeconsole.trace
.