polyfill: first draft to polyfill fetch api

This commit is contained in:
Pierre Tachoire
2024-11-27 16:34:40 +01:00
parent 3088c7a632
commit 4138c6fe95
7 changed files with 773 additions and 0 deletions

View File

@@ -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;