From 7183b0339b56a1454c3be1c0ff37d142605f316a Mon Sep 17 00:00:00 2001 From: Karl Seguin Date: Wed, 24 Dec 2025 08:00:26 +0800 Subject: [PATCH] fix crash on amazon product page --- src/browser/tests/document/get_elements_by_tag_name.html | 8 ++++++++ src/browser/webapi/collections/node_live.zig | 5 ++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/browser/tests/document/get_elements_by_tag_name.html b/src/browser/tests/document/get_elements_by_tag_name.html index 283953f1..89ab1470 100644 --- a/src/browser/tests/document/get_elements_by_tag_name.html +++ b/src/browser/tests/document/get_elements_by_tag_name.html @@ -153,3 +153,11 @@ } + diff --git a/src/browser/webapi/collections/node_live.zig b/src/browser/webapi/collections/node_live.zig index 68ca3b73..5e5f084d 100644 --- a/src/browser/webapi/collections/node_live.zig +++ b/src/browser/webapi/collections/node_live.zig @@ -114,8 +114,11 @@ pub fn NodeLive(comptime mode: Mode) type { if (self._last_length) |cached_length| { return cached_length; } + // not ideal, but this can happen if list[x] is called followed + // by list.length. + self._tw.reset(); + self._last_index = 0; } - // If we're here, it means it's either the first time we're called // or the DOM version has changed. Either way, the _tw should be // at the start position. It's important that self._last_index == 0