From 3cc53b579b97c017e69dfe9dc7af56443fc0dee4 Mon Sep 17 00:00:00 2001 From: Muki Kiboigo Date: Mon, 3 Nov 2025 07:01:50 -0800 Subject: [PATCH] add location set hash tests --- src/browser/html/location.zig | 2 +- src/tests/html/location.html | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/browser/html/location.zig b/src/browser/html/location.zig index 31be5a6b..0e12f933 100644 --- a/src/browser/html/location.zig +++ b/src/browser/html/location.zig @@ -52,7 +52,7 @@ pub const Location = struct { current_url; const normalized_hash = std.mem.trimStart(u8, hash, "#"); - const new_url = try std.fmt.allocPrint(page.arena, "{s}#{s}", .{ base_without_hash, normalized_hash }); + const new_url = try std.fmt.allocPrint(page.session.transfer_arena, "{s}#{s}", .{ base_without_hash, normalized_hash }); return page.navigateFromWebAPI(new_url, .{ .reason = .script }, .replace); } diff --git a/src/tests/html/location.html b/src/tests/html/location.html index c39ecb6f..863ae658 100644 --- a/src/tests/html/location.html +++ b/src/tests/html/location.html @@ -13,3 +13,13 @@ testing.expectEqual("9582", location.port); testing.expectEqual("", location.search); + +