From 37fa41b4a284a8774483b63d400d6406ccf0efa2 Mon Sep 17 00:00:00 2001 From: Karl Seguin Date: Tue, 30 Sep 2025 09:14:21 +0800 Subject: [PATCH] fix buffer ranges --- build.zig.zon | 6 +++--- src/browser/encoding/TextDecoder.zig | 5 +++-- src/tests/encoding/decoder.html | 9 ++++++--- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/build.zig.zon b/build.zig.zon index f1fbb67c..9004a506 100644 --- a/build.zig.zon +++ b/build.zig.zon @@ -5,9 +5,9 @@ .fingerprint = 0xda130f3af836cea0, .dependencies = .{ .v8 = .{ - .url = "https://github.com/lightpanda-io/zig-v8-fork/archive/c25223900587005c9cf13f25e56a7e0be26a533c.tar.gz", - .hash = "v8-0.0.0-xddH6x_DAwBh0gSbFFv1fyiExhExXKzZpbmj5sFH4MRY", + .url = "https://github.com/lightpanda-io/zig-v8-fork/archive/b51ed00390101b1fb9dd1ba4650c13f6586d0e24.tar.gz", + .hash = "v8-0.0.0-xddH68vFAwCYTTv4JjcgP7OcXSW7bv3sCKtaJ2SWXjR8", }, - // .v8 = .{ .path = "../zig-v8-fork" } + //.v8 = .{ .path = "../zig-v8-fork" } }, } diff --git a/src/browser/encoding/TextDecoder.zig b/src/browser/encoding/TextDecoder.zig index 8efe4102..811945b6 100644 --- a/src/browser/encoding/TextDecoder.zig +++ b/src/browser/encoding/TextDecoder.zig @@ -19,6 +19,7 @@ const std = @import("std"); const log = @import("../../log.zig"); +const Env = @import("../env.zig").Env; const Page = @import("../page.zig").Page; // https://encoding.spec.whatwg.org/#interface-textdecoder @@ -69,8 +70,8 @@ pub fn get_fatal(self: *const TextDecoder) bool { const DecodeOptions = struct { stream: bool = false, }; -pub fn _decode(self: *TextDecoder, input_: ?[]const u8, opts_: ?DecodeOptions, page: *Page) ![]const u8 { - var str = input_ orelse return ""; +pub fn _decode(self: *TextDecoder, str_: ?[]const u8, opts_: ?DecodeOptions, page: *Page) ![]const u8 { + var str = str_ orelse return ""; const opts: DecodeOptions = opts_ orelse .{}; if (self.stream.items.len > 0) { diff --git a/src/tests/encoding/decoder.html b/src/tests/encoding/decoder.html index dfdbd307..8a93dc46 100644 --- a/src/tests/encoding/decoder.html +++ b/src/tests/encoding/decoder.html @@ -47,11 +47,14 @@