mirror of
https://github.com/lightpanda-io/browser.git
synced 2025-10-28 22:53:28 +00:00
fix buffer ranges
This commit is contained in:
@@ -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" }
|
||||
},
|
||||
}
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -47,11 +47,14 @@
|
||||
</script>
|
||||
|
||||
<script id=slice>
|
||||
const buffer = new ArrayBuffer(4);
|
||||
const arr1 = new Uint8Array(buffer)
|
||||
const buf1 = new ArrayBuffer(7);
|
||||
const arr1 = new Uint8Array(buf1)
|
||||
arr1[0] = 80;
|
||||
arr1[1] = 81;
|
||||
arr1[2] = 82;
|
||||
arr1[3] = 83;
|
||||
testing.expectEqual('QR', d3.decode(new Uint8Array(buffer, 1, 2)));
|
||||
arr1[4] = 84;
|
||||
arr1[5] = 85;
|
||||
arr1[6] = 86;
|
||||
testing.expectEqual('RST', d3.decode(new Uint8Array(buf1, 2, 3)));
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user