mirror of
https://github.com/lightpanda-io/browser.git
synced 2025-10-30 07:31:47 +00:00
polyfill: first draft to polyfill fetch api
This commit is contained in:
@@ -33,6 +33,8 @@ const Client = @import("asyncio").Client;
|
||||
const Types = @import("../main_wpt.zig").Types;
|
||||
const UserContext = @import("../main_wpt.zig").UserContext;
|
||||
|
||||
const polyfill = @import("../polyfill/polyfill.zig");
|
||||
|
||||
// runWPT parses the given HTML file, starts a js env and run the first script
|
||||
// tags containing javascript sources.
|
||||
// It loads first the js libs files.
|
||||
@@ -74,6 +76,9 @@ pub fn run(arena: *std.heap.ArenaAllocator, comptime dir: []const u8, f: []const
|
||||
try js_env.start();
|
||||
defer js_env.stop();
|
||||
|
||||
// load polyfills
|
||||
try polyfill.load(alloc, js_env);
|
||||
|
||||
// display console logs
|
||||
defer {
|
||||
const res = evalJS(js_env, alloc, "console.join('\\n');", "console") catch unreachable;
|
||||
|
||||
Reference in New Issue
Block a user