-
Notifications
You must be signed in to change notification settings - Fork 286
Isolated world #554
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Isolated world #554
Conversation
15a5956 to
a698ff8
Compare
42e38fe to
de6bb18
Compare
| // constructor/FunctionTemplate as normal, but also through the default | ||
| // FunctionTemplate of the isolate (in startExecutor) | ||
| fn attachClass(self: *Self, comptime Struct: type, template: v8.FunctionTemplate) void { | ||
| fn attachClass(self: *const Self, comptime Struct: type, template: v8.FunctionTemplate) void { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like these functions should not be part of the struct
| }; | ||
|
|
||
| const Executor = struct {}; | ||
| const Env = struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These generic CDPT interfaces seem to give us very little for the amount of complexity they introduce
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might be possible to partially remove now and load the entire real env. Would probably still be a generic over the client though.
| name: []const u8, | ||
| grant_universal_access: bool, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We do not necessarily need to store these as they are not used at the moment.
Alternatively we could consider moving them into Executor as I expect that to merge towards being a Generic World type
| if (comptime builtin.mode == .Debug) { | ||
| std.debug.assert(self.has_executor == false); | ||
| self.has_executor = true; | ||
| if (kind == .main) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In main, the debug has_executor check has been removed to accommodate this PR. With it removed, you should be able to remove kind.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When getting to this statement myself I initially thought about removing it as well, however I found I could also simplify the opening and closing of the context with it. The I also thought it would just be good metadata to have, so I'd prefer keeping it regardless.
|
@sjorsdonkers can you upgrade the |
43f9526 to
8a9064b
Compare
Depends on: lightpanda-io/zig-v8-fork#57
Create an actually execution Context for Javascript to be executed in separately from the main context.