Make Bun.file() -> HTMLRewriter -> HTTP response work

This commit is contained in:
Jarred Sumner
2022-04-04 01:04:14 -07:00
parent a9f0d334bb
commit d820a9890f
5 changed files with 232 additions and 82 deletions

View File

@@ -494,6 +494,14 @@ pub const VirtualMachine = struct {
rare_data: ?*JSC.RareData = null,
pub inline fn nodeFS(this: *VirtualMachine) *Node.NodeFS {
return this.node_fs orelse brk: {
this.node_fs = bun.default_allocator.create(Node.NodeFS) catch unreachable;
this.node_fs.?.* = Node.NodeFS{ .async_io = undefined };
break :brk this.node_fs.?;
};
}
pub inline fn rareData(this: *VirtualMachine) *JSC.RareData {
return this.rare_data orelse brk: {
this.rare_data = this.allocator.create(JSC.RareData) catch unreachable;