Skip to content

Commit ab369bd

Browse files
committed
add assert and note on getCurrentEntry
1 parent 4c0461f commit ab369bd

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/browser/webapi/navigation/Navigation.zig

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,10 @@ pub fn getCanGoForward(self: *const Navigation) bool {
7272
}
7373

7474
pub fn getCurrentEntry(self: *Navigation) *NavigationHistoryEntry {
75+
// This should never fail. An entry should always be created before
76+
// we run the scripts on the page we are loading.
77+
std.debug.assert(self._entries.items.len > 0);
78+
7579
return self._entries.items[self._index];
7680
}
7781

0 commit comments

Comments
 (0)