mirror of
https://github.com/lightpanda-io/browser.git
synced 2025-10-29 07:03:29 +00:00
Update jsruntime + fix breaking changes
Signed-off-by: Francis Bouvier <francis.bouvier@gmail.com>
This commit is contained in:
@@ -50,7 +50,7 @@ fn execJS(
|
|||||||
pub fn main() !void {
|
pub fn main() !void {
|
||||||
|
|
||||||
// generate APIs
|
// generate APIs
|
||||||
const apis = jsruntime.compile(DOM.Interfaces);
|
const apis = try jsruntime.compile(DOM.Interfaces);
|
||||||
|
|
||||||
// create v8 vm
|
// create v8 vm
|
||||||
const vm = jsruntime.VM.init();
|
const vm = jsruntime.VM.init();
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ fn execJS(
|
|||||||
pub fn main() !void {
|
pub fn main() !void {
|
||||||
|
|
||||||
// generate APIs
|
// generate APIs
|
||||||
const apis = jsruntime.compile(DOM.Interfaces);
|
const apis = try jsruntime.compile(DOM.Interfaces);
|
||||||
|
|
||||||
// allocator
|
// allocator
|
||||||
var gpa = std.heap.GeneralPurposeAllocator(.{}){};
|
var gpa = std.heap.GeneralPurposeAllocator(.{}){};
|
||||||
|
|||||||
@@ -12,9 +12,6 @@ const HTMLElem = @import("html/elements.zig");
|
|||||||
|
|
||||||
const wpt_dir = "tests/wpt";
|
const wpt_dir = "tests/wpt";
|
||||||
|
|
||||||
// generate APIs
|
|
||||||
const apis = jsruntime.compile(DOM.Interfaces);
|
|
||||||
|
|
||||||
// FileLoader loads files content from the filesystem.
|
// FileLoader loads files content from the filesystem.
|
||||||
const FileLoader = struct {
|
const FileLoader = struct {
|
||||||
const FilesMap = std.StringHashMap([]const u8);
|
const FilesMap = std.StringHashMap([]const u8);
|
||||||
@@ -65,6 +62,10 @@ const FileLoader = struct {
|
|||||||
// Once browsercore will have the html loader, it would be useful to refacto
|
// Once browsercore will have the html loader, it would be useful to refacto
|
||||||
// this test to use it.
|
// this test to use it.
|
||||||
pub fn main() !void {
|
pub fn main() !void {
|
||||||
|
|
||||||
|
// generate APIs
|
||||||
|
const apis = comptime try jsruntime.compile(DOM.Interfaces);
|
||||||
|
|
||||||
std.debug.print("Running WPT test suite\n", .{});
|
std.debug.print("Running WPT test suite\n", .{});
|
||||||
|
|
||||||
var gpa = std.heap.GeneralPurposeAllocator(.{}){};
|
var gpa = std.heap.GeneralPurposeAllocator(.{}){};
|
||||||
@@ -122,7 +123,7 @@ pub fn main() !void {
|
|||||||
|
|
||||||
// TODO I don't use testing.expect here b/c I want to execute all the
|
// TODO I don't use testing.expect here b/c I want to execute all the
|
||||||
// tests. And testing.expect stops running test in the first failure.
|
// tests. And testing.expect stops running test in the first failure.
|
||||||
const res = runWPT(&arena, tc, &loader) catch |err| {
|
const res = runWPT(&arena, apis, tc, &loader) catch |err| {
|
||||||
std.debug.print("FAIL\t{s}\n{any}\n", .{ tc, err });
|
std.debug.print("FAIL\t{s}\n{any}\n", .{ tc, err });
|
||||||
failures += 1;
|
failures += 1;
|
||||||
continue;
|
continue;
|
||||||
@@ -152,7 +153,7 @@ pub fn main() !void {
|
|||||||
// runWPT parses the given HTML file, starts a js env and run the first script
|
// runWPT parses the given HTML file, starts a js env and run the first script
|
||||||
// tags containing javascript sources.
|
// tags containing javascript sources.
|
||||||
// It loads first the js libs files.
|
// It loads first the js libs files.
|
||||||
fn runWPT(arena: *std.heap.ArenaAllocator, f: []const u8, loader: *FileLoader) !jsruntime.JSResult {
|
fn runWPT(arena: *std.heap.ArenaAllocator, comptime apis: []jsruntime.API, f: []const u8, loader: *FileLoader) !jsruntime.JSResult {
|
||||||
const alloc = arena.allocator();
|
const alloc = arena.allocator();
|
||||||
|
|
||||||
// document
|
// document
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ test {
|
|||||||
try generate.tests();
|
try generate.tests();
|
||||||
|
|
||||||
// generate APIs
|
// generate APIs
|
||||||
const apis = jsruntime.compile(DOM.Interfaces);
|
const apis = try jsruntime.compile(DOM.Interfaces);
|
||||||
|
|
||||||
// create JS vm
|
// create JS vm
|
||||||
const vm = jsruntime.VM.init();
|
const vm = jsruntime.VM.init();
|
||||||
|
|||||||
2
vendor/jsruntime-lib
vendored
2
vendor/jsruntime-lib
vendored
Submodule vendor/jsruntime-lib updated: 3b53c93cf3...bde400eae6
Reference in New Issue
Block a user