Skip to content

Commit 1d25fcf

Browse files
committed
Frame.getScriptName can be null
1 parent faab449 commit 1d25fcf

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/v8.zig

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1572,10 +1572,12 @@ pub const StackFrame = struct {
15721572
return @as(u32, @intCast(c.v8__StackFrame__GetScriptId(self.handle)));
15731573
}
15741574

1575-
pub fn getScriptName(self: Self) String {
1576-
return .{
1577-
.handle = c.v8__StackFrame__GetScriptName(self.handle).?,
1578-
};
1575+
pub fn getScriptName(self: Self) ?String {
1576+
if (c.v8__StackFrame__GetFunctionName(self.handle)) |ptr| {
1577+
return .{
1578+
.handle = ptr,
1579+
};
1580+
} else return null;
15791581
}
15801582

15811583
pub fn getScriptNameOrSourceUrl(self: Self) String {

0 commit comments

Comments
 (0)