Merge pull request #2385 from lightpanda-io/avoid_script_error_double_free

On error, don't free headers
This commit is contained in:
Karl Seguin
2026-05-07 22:11:58 +08:00
committed by GitHub
2 changed files with 1 additions and 2 deletions

View File

@@ -233,7 +233,6 @@ pub fn addFromElement(self: *ScriptManager, comptime from_parser: bool, script_e
defer self.base.is_evaluating = was_evaluating;
const headers = try self.getHeaders();
errdefer headers.deinit();
if (is_blocking) {
const response = try self.base.client.syncRequest(arena, .{

View File

@@ -181,7 +181,7 @@ fn getThis(self: *const Function) js.Object {
}
pub fn src(self: *const Function) ![]const u8 {
return self.local.valueToString(.{ .local = self.local, .handle = @ptrCast(self.handle) }, .{});
return js.Value.toStringSlice(.{ .local = self.local, .handle = @ptrCast(self.handle) });
}
pub fn getPropertyValue(self: *const Function, name: []const u8) !?js.Value {