Re-introduce postAttach

index_get seems to be ~1000x slower than setting the value directly on the
v8.Object. There's a lot of information on "v8 fast properties", and values
set directly on objects seem to be heavily optimized. Still, I can't imagine
indexed properties are always _that_ slow, so I must be doing something wrong.
Still, for now, this brings back the original functionality / behavior / perf.

Introduce the ability for Zig functions to take a Env.JsObject parameter. While
this isn't currently being used, it aligns with bringing back the postAttach /
JSObject functionality in main.

Moved function *State to the end of the function list (making it consistent with
getters and setters). The optional Env.JsObject parameter comes after the
optional state.

Removed some uncessary arena deinits from a few webapis.
This commit is contained in:
Karl Seguin
2025-04-17 09:26:37 +08:00
parent e3638053d0
commit f4e8bb6c66
24 changed files with 201 additions and 157 deletions

View File

@@ -480,7 +480,7 @@ pub const JsRunner = struct {
return self.executor.exec(src, null) catch |err| {
if (try try_catch.err(self.arena)) |msg| {
err_msg.* = msg;
std.debug.print("Error runnign script: {s}\n", .{msg});
std.debug.print("Error running script: {s}\n", .{msg});
}
return err;
};