mirror of
https://github.com/lightpanda-io/browser.git
synced 2025-10-30 07:31:47 +00:00
Improve the debug ergonomics of the Env generic.
Previously, we were passing our WebAPIs directly as an anonymous tuple. This resulted in Env(T) having an _awful_ name - a name composed of hundreds of classes. By wrapping the anonymous tuple into a normal struct, the Env now gets a sane name which helps improve stack traces (and profiling, and debugging, ...)
This commit is contained in:
@@ -26,7 +26,7 @@ pub const allocator = std.testing.allocator;
|
||||
// browser.Env or the browser.SessionState
|
||||
pub fn Runner(comptime State: type, comptime Global: type, comptime types: anytype) type {
|
||||
const AdjustedTypes = if (Global == void) generate.Tuple(.{ types, DefaultGlobal }) else types;
|
||||
const Env = js.Env(State, AdjustedTypes{});
|
||||
const Env = js.Env(State, struct {pub const Interfaces = AdjustedTypes;});
|
||||
|
||||
return struct {
|
||||
env: *Env,
|
||||
|
||||
Reference in New Issue
Block a user