Adopt global Types changes in jsruntime

Signed-off-by: Francis Bouvier <francis@lightpanda.io>
This commit is contained in:
Francis Bouvier
2024-01-10 11:56:53 +01:00
parent c812ff300a
commit a5dfa6cb44
20 changed files with 49 additions and 69 deletions

View File

@@ -55,8 +55,7 @@ pub const Attr = struct {
pub fn testExecFn(
_: std.mem.Allocator,
js_env: *jsruntime.Env,
comptime _: []jsruntime.API,
) !void {
) anyerror!void {
var getters = [_]Case{
.{ .src = "let a = document.createAttributeNS('foo', 'bar')", .ex = "undefined" },
.{ .src = "a.namespaceURI", .ex = "foo" },

View File

@@ -92,8 +92,7 @@ pub const CharacterData = struct {
pub fn testExecFn(
_: std.mem.Allocator,
js_env: *jsruntime.Env,
comptime _: []jsruntime.API,
) !void {
) anyerror!void {
var get_data = [_]Case{
.{ .src = "let link = document.getElementById('link')", .ex = "undefined" },
.{ .src = "let cdata = link.firstChild", .ex = "undefined" },

View File

@@ -251,8 +251,7 @@ pub const Document = struct {
pub fn testExecFn(
_: std.mem.Allocator,
js_env: *jsruntime.Env,
comptime _: []jsruntime.API,
) !void {
) anyerror!void {
var constructor = [_]Case{
.{ .src = "document.__proto__.__proto__.constructor.name", .ex = "Document" },
.{ .src = "document.__proto__.__proto__.__proto__.constructor.name", .ex = "Node" },

View File

@@ -290,8 +290,7 @@ pub const Element = struct {
pub fn testExecFn(
_: std.mem.Allocator,
js_env: *jsruntime.Env,
comptime _: []jsruntime.API,
) !void {
) anyerror!void {
var getters = [_]Case{
.{ .src = "let g = document.getElementById('content')", .ex = "undefined" },
.{ .src = "g.namespaceURI", .ex = "http://www.w3.org/1999/xhtml" },

View File

@@ -147,8 +147,7 @@ pub const DOMException = struct {
pub fn testExecFn(
_: std.mem.Allocator,
js_env: *jsruntime.Env,
comptime _: []jsruntime.API,
) !void {
) anyerror!void {
const err = "Failed to execute 'appendChild' on 'Node': The new child element contains the parent.";
var cases = [_]Case{
.{ .src = "let content = document.getElementById('content')", .ex = "undefined" },

View File

@@ -338,8 +338,7 @@ pub const HTMLCollection = struct {
pub fn testExecFn(
_: std.mem.Allocator,
js_env: *jsruntime.Env,
comptime _: []jsruntime.API,
) !void {
) anyerror!void {
var getElementsByTagName = [_]Case{
.{ .src = "let getElementsByTagName = document.getElementsByTagName('p')", .ex = "undefined" },
.{ .src = "getElementsByTagName.length", .ex = "2" },

View File

@@ -74,8 +74,7 @@ pub const DOMImplementation = struct {
pub fn testExecFn(
_: std.mem.Allocator,
js_env: *jsruntime.Env,
comptime _: []jsruntime.API,
) !void {
) anyerror!void {
var getImplementation = [_]Case{
.{ .src = "let impl = document.implementation", .ex = "undefined" },
.{ .src = "impl.createHTMLDocument();", .ex = "[object Document]" },

View File

@@ -65,8 +65,7 @@ pub const NamedNodeMap = struct {
pub fn testExecFn(
_: std.mem.Allocator,
js_env: *jsruntime.Env,
comptime _: []jsruntime.API,
) !void {
) anyerror!void {
var setItem = [_]Case{
.{ .src = "let a = document.getElementById('content').attributes", .ex = "undefined" },
.{ .src = "a.length", .ex = "1" },

View File

@@ -264,8 +264,7 @@ pub const Node = struct {
pub fn testExecFn(
alloc: std.mem.Allocator,
js_env: *jsruntime.Env,
comptime _: []jsruntime.API,
) !void {
) anyerror!void {
// helper functions
const trim_and_replace =

View File

@@ -61,8 +61,7 @@ pub const NodeList = struct {
pub fn testExecFn(
_: std.mem.Allocator,
js_env: *jsruntime.Env,
comptime _: []jsruntime.API,
) !void {
) anyerror!void {
var childnodes = [_]Case{
.{ .src = "let list = document.getElementById('content').childNodes", .ex = "undefined" },
.{ .src = "list.length", .ex = "9" },

View File

@@ -43,8 +43,7 @@ pub const Text = struct {
pub fn testExecFn(
_: std.mem.Allocator,
js_env: *jsruntime.Env,
comptime _: []jsruntime.API,
) !void {
) anyerror!void {
var get_whole_text = [_]Case{
.{ .src = "let text = document.getElementById('link').firstChild", .ex = "undefined" },
.{ .src = "text.wholeText === 'OK'", .ex = "true" },

View File

@@ -98,8 +98,7 @@ pub const DOMTokenList = struct {
pub fn testExecFn(
_: std.mem.Allocator,
js_env: *jsruntime.Env,
comptime _: []jsruntime.API,
) !void {
) anyerror!void {
var dynamiclist = [_]Case{
.{ .src = "let gs = document.getElementById('para-empty')", .ex = "undefined" },
.{ .src = "let cl = gs.classList", .ex = "undefined" },