Skip to content

Commit 2701c83

Browse files
committed
Make getCurrentScriptNameOrSourceUrl safe to call even when no script
1 parent 7a1beb0 commit 2701c83

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/v8.zig

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1583,9 +1583,10 @@ pub const StackTrace = struct {
15831583
};
15841584
}
15851585

1586-
pub fn getCurrentScriptNameOrSourceUrl(iso: Isolate) String {
1586+
pub fn getCurrentScriptNameOrSourceUrl(iso: Isolate) ?String {
1587+
const handle = c.v8__StackTrace__CurrentScriptNameOrSourceURL__STATIC(iso.handle) orelse return null;
15871588
return .{
1588-
.handle = c.v8__StackTrace__CurrentScriptNameOrSourceURL__STATIC(iso.handle).?,
1589+
.handle = handle,
15891590
};
15901591
}
15911592
};

0 commit comments

Comments
 (0)