From 443aef4f76e1aade98df1600e8dfbbae5dedcac6 Mon Sep 17 00:00:00 2001 From: Pierre Tachoire Date: Mon, 27 Nov 2023 16:31:41 +0100 Subject: [PATCH] dom: add DOMImplementation.hasFeature --- src/dom/implementation.zig | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/dom/implementation.zig b/src/dom/implementation.zig index 0caa011a..138422db 100644 --- a/src/dom/implementation.zig +++ b/src/dom/implementation.zig @@ -63,6 +63,10 @@ pub const DOMImplementation = struct { return doc; } + pub fn _hasFeature(_: *DOMImplementation) bool { + return true; + } + pub fn deinit(_: *DOMImplementation, _: std.mem.Allocator) void {} }; @@ -78,7 +82,8 @@ pub fn testExecFn( .{ .src = "let impl = document.implementation", .ex = "undefined" }, .{ .src = "impl.createHTMLDocument();", .ex = "[object Document]" }, .{ .src = "impl.createDocument(null, 'foo');", .ex = "[object Document]" }, - .{ .src = "impl.createDocumentType('foo', 'bar', 'baz');", .ex = "[object DocumentType]" }, + .{ .src = "impl.createDocumentType('foo', 'bar', 'baz')", .ex = "[object DocumentType]" }, + .{ .src = "impl.hasFeature()", .ex = "true" }, }; try checkCases(js_env, &getImplementation); }