Skip to content

Commit

Permalink
allow V8Inspector::create_stack_trace with empty local (#1684)
Browse files Browse the repository at this point in the history
  • Loading branch information
littledivy authored Jan 29, 2025
1 parent 7cd928a commit 5dfb2f9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/inspector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1041,12 +1041,12 @@ impl V8Inspector {

pub fn create_stack_trace(
&mut self,
stack_trace: Local<StackTrace>,
stack_trace: Option<Local<StackTrace>>,
) -> UniquePtr<V8StackTrace> {
unsafe {
UniquePtr::from_raw(v8_inspector__V8Inspector__createStackTrace(
self,
&*stack_trace,
stack_trace.map_or(null(), |v| &*v),
))
}
}
Expand Down
2 changes: 1 addition & 1 deletion tests/test_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6847,7 +6847,7 @@ fn inspector_exception_thrown() {
v8::String::new(&mut context_scope, "This is a test error").unwrap();
let exception = v8::Exception::error(&mut context_scope, exception_msg);
let stack_trace =
v8::Exception::get_stack_trace(&mut context_scope, exception).unwrap();
v8::Exception::get_stack_trace(&mut context_scope, exception);
let stack_trace_ptr = inspector.create_stack_trace(stack_trace);
let _id = inspector.exception_thrown(
context,
Expand Down

0 comments on commit 5dfb2f9

Please sign in to comment.