Remove js.ExecutionWorld

The ExecutionWorld doesn't do anything meaningful. It doesn't map to, or
abstract any, v8 concepts. It creates a js.Context, destroys the context and
points to the context. Those all all things the Env can do (and it isn't like
the Env is over-burdened as-is).

Plus the benefit of going through the Env is that we can track/collect all
known Contexts for an isolate in 1 place (the Env), which can facilitate things
like context creation/deletion notifications.
This commit is contained in:
Karl Seguin
2026-01-29 11:22:01 +08:00
parent 232e7a1759
commit 1a05da9e55
11 changed files with 132 additions and 192 deletions

View File

@@ -190,8 +190,7 @@ fn createIsolatedWorld(cmd: anytype) !void {
const world = try bc.createIsolatedWorld(params.worldName, params.grantUniveralAccess);
const page = bc.session.currentPage() orelse return error.PageNotLoaded;
try world.createContext(page);
const js_context = &world.executor.context.?;
const js_context = try world.createContext(page);
// Create the auxdata json for the contextCreated event
// Calling contextCreated will assign a Id to the context and send the contextCreated event
@@ -292,7 +291,7 @@ pub fn pageRemove(bc: anytype) !void {
pub fn pageCreated(bc: anytype, page: *Page) !void {
for (bc.isolated_worlds.items) |*isolated_world| {
try isolated_world.createContext(page);
_ = try isolated_world.createContext(page);
}
}
@@ -375,7 +374,7 @@ pub fn pageNavigated(arena: Allocator, bc: anytype, event: *const Notification.P
// Calling contextCreated will assign a new Id to the context and send the contextCreated event
var ls: js.Local.Scope = undefined;
(isolated_world.executor.context orelse continue).localScope(&ls);
(isolated_world.context orelse continue).localScope(&ls);
defer ls.deinit();
bc.inspector.contextCreated(