Skip to content

Commit 5dfb2f9

Browse files
authored
allow V8Inspector::create_stack_trace with empty local (#1684)
1 parent 7cd928a commit 5dfb2f9

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/inspector.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1041,12 +1041,12 @@ impl V8Inspector {
10411041

10421042
pub fn create_stack_trace(
10431043
&mut self,
1044-
stack_trace: Local<StackTrace>,
1044+
stack_trace: Option<Local<StackTrace>>,
10451045
) -> UniquePtr<V8StackTrace> {
10461046
unsafe {
10471047
UniquePtr::from_raw(v8_inspector__V8Inspector__createStackTrace(
10481048
self,
1049-
&*stack_trace,
1049+
stack_trace.map_or(null(), |v| &*v),
10501050
))
10511051
}
10521052
}

tests/test_api.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6847,7 +6847,7 @@ fn inspector_exception_thrown() {
68476847
v8::String::new(&mut context_scope, "This is a test error").unwrap();
68486848
let exception = v8::Exception::error(&mut context_scope, exception_msg);
68496849
let stack_trace =
6850-
v8::Exception::get_stack_trace(&mut context_scope, exception).unwrap();
6850+
v8::Exception::get_stack_trace(&mut context_scope, exception);
68516851
let stack_trace_ptr = inspector.create_stack_trace(stack_trace);
68526852
let _id = inspector.exception_thrown(
68536853
context,

0 commit comments

Comments
 (0)