mirror of
https://github.com/lightpanda-io/browser.git
synced 2025-10-29 15:13:28 +00:00
fix some spelling in comments
This commit is contained in:
@@ -336,7 +336,7 @@ pub const Page = struct {
|
||||
|
||||
const http_active = http_client.active;
|
||||
if (http_active == 0 and exit_when_done) {
|
||||
// we don't need to concider http_client.intercepted here
|
||||
// we don't need to consider http_client.intercepted here
|
||||
// because exit_when_done is true, and that can only be
|
||||
// the case when interception isn't possible.
|
||||
std.debug.assert(http_client.intercepted == 0);
|
||||
@@ -823,12 +823,12 @@ pub const Page = struct {
|
||||
}
|
||||
|
||||
// The transfer arena is useful and interesting, but has a weird lifetime.
|
||||
// When we're transfering from one page to another (via delayed navigation)
|
||||
// When we're transferring from one page to another (via delayed navigation)
|
||||
// we need things in memory: like the URL that we're navigating to and
|
||||
// optionally the body to POST. That cannot exist in the page.arena, because
|
||||
// the page that we have is going to be destroyed and a new page is going
|
||||
// to be created. If we used the page.arena, we'd wouldn't be able to reset
|
||||
// it between navigations.
|
||||
// it between navigation.
|
||||
// So the transfer arena is meant to exist between a navigation event. It's
|
||||
// freed when the main html navigation is complete, either in pageDoneCallback
|
||||
// or pageErrorCallback. It needs to exist for this long because, if we set
|
||||
@@ -1159,7 +1159,7 @@ pub export fn scriptAddedCallback(ctx: ?*anyopaque, element: ?*parser.Element) c
|
||||
return;
|
||||
}
|
||||
|
||||
// It's posisble for a script to be dynamically added without a src.
|
||||
// It's possible for a script to be dynamically added without a src.
|
||||
// const s = document.createElement('script');
|
||||
// document.getElementsByTagName('body')[0].appendChild(s);
|
||||
// The src can be set after. We handle that in HTMLScriptElement.set_src,
|
||||
|
||||
@@ -1395,7 +1395,7 @@ pub fn Env(comptime State: type, comptime WebApis: type) type {
|
||||
},
|
||||
.@"struct" => {
|
||||
// We don't want to duplicate the code for this, so we call
|
||||
// the actual coversion function.
|
||||
// the actual conversion function.
|
||||
const value = (try self.jsValueToStruct(named_function, T, js_value)) orelse {
|
||||
return .{ .invalid = {} };
|
||||
};
|
||||
@@ -1494,7 +1494,7 @@ pub fn Env(comptime State: type, comptime WebApis: type) type {
|
||||
|
||||
// We were hoping to find the module in our cache, and thus used
|
||||
// the short-lived call_arena to create the normalized_specifier.
|
||||
// But now this'll live for the lifetime of the context.
|
||||
// But now this will live for the lifetime of the context.
|
||||
const arena = self.context_arena;
|
||||
const owned_specifier = try arena.dupe(u8, normalized_specifier);
|
||||
try self.module_cache.put(arena, owned_specifier, PersistentModule.init(self.isolate, m));
|
||||
@@ -2098,7 +2098,7 @@ pub fn Env(comptime State: type, comptime WebApis: type) type {
|
||||
// a shorthand method to return either the entire stack message
|
||||
// or just the exception message
|
||||
// - in Debug mode return the stack if available
|
||||
// - otherwhise return the exception if available
|
||||
// - otherwise return the exception if available
|
||||
// the caller needs to deinit the string returned
|
||||
pub fn err(self: TryCatch, allocator: Allocator) !?[]const u8 {
|
||||
if (builtin.mode == .Debug) {
|
||||
@@ -2751,7 +2751,7 @@ pub fn Env(comptime State: type, comptime WebApis: type) type {
|
||||
}
|
||||
|
||||
if (T == Function) {
|
||||
// we're returnig a callback
|
||||
// we're returning a callback
|
||||
return value.func.toValue();
|
||||
}
|
||||
|
||||
@@ -2876,8 +2876,8 @@ pub fn Env(comptime State: type, comptime WebApis: type) type {
|
||||
}
|
||||
};
|
||||
|
||||
// Callback called on global's property mssing.
|
||||
// Return true to intercept the exectution or false to let the call
|
||||
// Callback called on global's property missing.
|
||||
// Return true to intercept the execution or false to let the call
|
||||
// continue the chain.
|
||||
pub const GlobalMissingCallback = struct {
|
||||
ptr: *anyopaque,
|
||||
@@ -2951,10 +2951,10 @@ fn isComplexAttributeType(ti: std.builtin.Type) bool {
|
||||
};
|
||||
}
|
||||
|
||||
// Responsible for calling Zig functions from JS invokations. This could
|
||||
// Responsible for calling Zig functions from JS invocations. This could
|
||||
// probably just contained in ExecutionWorld, but having this specific logic, which
|
||||
// is somewhat repetitive between constructors, functions, getters, etc contained
|
||||
// here does feel like it makes it clenaer.
|
||||
// here does feel like it makes it cleaner.
|
||||
fn Caller(comptime JsContext: type, comptime State: type) type {
|
||||
return struct {
|
||||
js_context: *JsContext,
|
||||
@@ -3356,7 +3356,7 @@ fn Caller(comptime JsContext: type, comptime State: type) type {
|
||||
var is_variadic = false;
|
||||
|
||||
{
|
||||
// This is going to get complicated. If the last Zig paremeter
|
||||
// This is going to get complicated. If the last Zig parameter
|
||||
// is a slice AND the corresponding javascript parameter is
|
||||
// NOT an an array, then we'll treat it as a variadic.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user