v8: update for changes to v8__String__WriteUtf8

https://github.com/lightpanda-io/zig-v8-fork/pull/211
This commit is contained in:
Karl Seguin committed 2026-09-25 11:52:42 +08:00
1 parent 722241fe0d
commit db98e85ce3
8 files changed
+13 -12

No files matched your search

+1 -1
View File
@@ -13,7 +13,7 @@ inputs:
zig-v8:
description: 'zig v8 version to install'
required: false
default: 'v0.5.6'
default: 'v0.5.7'
v8:
description: 'v8 version to install'
required: false
+1 -1
View File
@@ -13,7 +13,7 @@ inputs:
zig-v8:
description: 'zig-v8 release tag the prebuilt lib came from'
required: false
default: 'v0.5.6'
default: 'v0.5.7'
runs:
using: "composite"
+1 -1
View File
@@ -4,7 +4,7 @@ FROM debian:stable-slim
ARG MINISIG=0.12
ARG ZIG_MINISIG=RWSGOq2NVecA2UPNdBUZykf1CCb147pkmdtYxgb3Ti+JO/wCYvhbAb/U
ARG V8=14.9.207.35
ARG ZIG_V8=v0.5.6
ARG ZIG_V8=v0.5.7
ARG TARGETPLATFORM
RUN apt-get update -yq && \
+2 -2
View File
@@ -5,8 +5,8 @@
.minimum_zig_version = "0.16.0",
.dependencies = .{
.v8 = .{
.url = "https://github.com/lightpanda-io/zig-v8-fork/archive/d3d7b41677a0015fdfa55a8b1caa4f214de6d209.tar.gz",
.hash = "v8-0.0.0-xddH624yAwC5_H_8T303uTxiSAnAu2zrxv6MHLhvLo6t",
.url = "https://github.com/lightpanda-io/zig-v8-fork/archive/ebd2fabfb001294ed43ef65286c7db17245416e9.tar.gz",
.hash = "v8-0.0.0-xddH66lEAwB-5Ec92QAp19-aZ6-oB8UnnUm-w3fBUEaX",
},
// .v8 = .{ .path = "../zig-v8-fork" },
.brotli = .{
+1 -1
View File
@@ -668,7 +668,7 @@ fn illegalConstructorCallback(raw_info: ?*const v8.FunctionCallbackInfo) callcon
if (v8.v8__Function__GetName(func)) |name_value| {
if (v8.v8__Value__IsString(name_value)) {
const str: *const v8.String = @ptrCast(name_value);
const n = v8.v8__String__WriteUtf8(str, isolate, &name_buf, name_buf.len, v8.NO_NULL_TERMINATION | v8.REPLACE_INVALID_UTF8);
const n = v8.v8__String__WriteUtf8(str, isolate, &name_buf, name_buf.len, v8.WRITE_REPLACE_INVALID_UTF8, null);
name = name_buf[0..@intCast(n)];
}
}
+4 -4
View File
@@ -65,7 +65,7 @@ fn _toSlice(self: String, comptime null_terminate: bool, allocator: Allocator) !
const l = v8.v8__String__Utf8Length(handle, isolate);
const buf = try (if (comptime null_terminate) allocator.allocSentinel(u8, @intCast(l), 0) else allocator.alloc(u8, @intCast(l)));
const n = v8.v8__String__WriteUtf8(handle, isolate, buf.ptr, buf.len, v8.NO_NULL_TERMINATION | v8.REPLACE_INVALID_UTF8);
const n = v8.v8__String__WriteUtf8(handle, isolate, buf.ptr, buf.len, v8.WRITE_REPLACE_INVALID_UTF8, null);
if (comptime lp.IS_DEBUG) {
std.debug.assert(n == l);
}
@@ -87,7 +87,7 @@ pub fn toSSOWithAlloc(self: String, allocator: Allocator) !lp.String {
if (l <= 12) {
var content: [12]u8 = undefined;
const n = v8.v8__String__WriteUtf8(handle, isolate, &content[0], content.len, v8.NO_NULL_TERMINATION | v8.REPLACE_INVALID_UTF8);
const n = v8.v8__String__WriteUtf8(handle, isolate, &content[0], content.len, v8.WRITE_REPLACE_INVALID_UTF8, null);
if (comptime lp.IS_DEBUG) {
std.debug.assert(n == l);
}
@@ -103,7 +103,7 @@ pub fn toSSOWithAlloc(self: String, allocator: Allocator) !lp.String {
}
const buf = try allocator.alloc(u8, l);
const n = v8.v8__String__WriteUtf8(handle, isolate, buf.ptr, buf.len, v8.NO_NULL_TERMINATION | v8.REPLACE_INVALID_UTF8);
const n = v8.v8__String__WriteUtf8(handle, isolate, buf.ptr, buf.len, v8.WRITE_REPLACE_INVALID_UTF8, null);
if (comptime lp.IS_DEBUG) {
std.debug.assert(n == l);
}
@@ -124,7 +124,7 @@ pub fn format(self: String, writer: *std.Io.Writer) !void {
const l = v8.v8__String__Utf8Length(handle, isolate);
var buf = if (l < 1024) &small else local.call_arena.alloc(u8, @intCast(l)) catch return error.WriteFailed;
const n = v8.v8__String__WriteUtf8(handle, isolate, buf.ptr, buf.len, v8.NO_NULL_TERMINATION | v8.REPLACE_INVALID_UTF8);
const n = v8.v8__String__WriteUtf8(handle, isolate, buf.ptr, buf.len, v8.WRITE_REPLACE_INVALID_UTF8, null);
return writer.writeAll(buf[0..n]);
}
+1 -1
View File
@@ -598,7 +598,7 @@ pub fn writeStackTrace(isolate: *v8.Isolate, stack_handle: *const v8.StackTrace,
const frame_handle = v8.v8__StackTrace__GetFrame(stack_handle, isolate, @intCast(i)).?;
if (v8.v8__StackFrame__GetFunctionName(frame_handle)) |name| {
var buf: [1024]u8 = undefined;
const n = v8.v8__String__WriteUtf8(name, isolate, &buf, buf.len, v8.NO_NULL_TERMINATION | v8.REPLACE_INVALID_UTF8);
const n = v8.v8__String__WriteUtf8(name, isolate, &buf, buf.len, v8.WRITE_REPLACE_INVALID_UTF8, null);
try writer.print("{s}{s}:{d}", .{ separator, buf[0..n], v8.v8__StackFrame__GetLineNumber(frame_handle) });
} else {
try writer.print("{s}<anonymous>:{d}", .{ separator, v8.v8__StackFrame__GetLineNumber(frame_handle) });
+2 -1
View File
@@ -975,7 +975,8 @@ fn stringToOwned(
self.env.isolate.handle,
buf.ptr,
buf.len,
v8.NO_NULL_TERMINATION | v8.REPLACE_INVALID_UTF8,
v8.WRITE_REPLACE_INVALID_UTF8,
null,
);
return buf[0..written];
}