diff --git a/src/dom/document.zig b/src/dom/document.zig
index c99cc5f..811df9d 100644
--- a/src/dom/document.zig
+++ b/src/dom/document.zig
@@ -348,6 +348,7 @@ pub fn testExecFn(
var createProcessingInstruction = [_]Case{
.{ .src = "let pi = document.createProcessingInstruction('foo', 'bar')", .ex = "undefined" },
.{ .src = "pi.target", .ex = "foo" },
+ .{ .src = "let pi2 = pi.cloneNode()", .ex = "undefined" },
};
try checkCases(js_env, &createProcessingInstruction);
diff --git a/src/dom/processing_instruction.zig b/src/dom/processing_instruction.zig
index 2fa24ee..6a5e6f6 100644
--- a/src/dom/processing_instruction.zig
+++ b/src/dom/processing_instruction.zig
@@ -1,6 +1,7 @@
const std = @import("std");
const parser = @import("../netsurf.zig");
+const CharacterData = @import("character_data.zig").CharacterData;
// https://dom.spec.whatwg.org/#processinginstruction
pub const ProcessingInstruction = struct {
@@ -14,7 +15,7 @@ pub const ProcessingInstruction = struct {
// In consequence, for now, we don't implement all these func for
// ProcessingInstruction.
//
- //pub const prototype = *CharacterData;
+ pub const prototype = *CharacterData;
pub const mem_guarantied = true;
$ make test
Testing...
run test: error:
Generate Union: OK
Generate Tuple: OK
Segmentation fault at address 0x7fff82f0f060
???:?:?: 0x7fff82f0f060 in ??? (???)
Unwind information for `???:0x7fff82f0f060` was not available, trace may be incomplete
/home/pierre/wrk/browsercore/src/dom/node.zig:50:43: 0xbb7a26 in toInterface (test)
return switch (try parser.nodeType(node)) {
^
/home/pierre/wrk/browsercore/src/dom/node.zig:172:36: 0xbe9b95 in _cloneNode (test)
return try Node.toInterface(clone);
^
/home/pierre/wrk/browsercore/vendor/jsruntime-lib/src/engines/v8/generate.zig:781:13: 0xb68e9e in method (test)
const res = @call(.auto, method_func, args);
^
../../../../v8/src/api/api-arguments-inl.h:146:3: 0x26e9039 in Call (../../../../v8/src/builtins/builtins-api.cc)
../../../../v8/src/builtins/builtins-api.cc:113:36: 0x26e79ef in HandleApiCallHelper<false> (../../../../v8/src/builtins/builtins-api.cc)
../../../../v8/src/builtins/builtins-api.cc:148:5: 0x26e6150 in Builtin_Impl_HandleApiCall (../../../../v8/src/builtins/builtins-api.cc)
../../../../v8/src/builtins/builtins-api.cc:135:1: 0x26e5c16 in Builtin_HandleApiCall (../../../../v8/src/builtins/builtins-api.cc)
???:?:?: 0x11b94be in ??? (???)
???:?:?: 0xe22e8d in ??? (???)
???:?:?: 0xe1b69b in ??? (???)
???:?:?: 0xe1b3c6 in ??? (???)
../../../../v8/src/execution/simulator.h:155:12: 0x1c29cfa in Invoke (../../../../v8/src/execution/execution.cc)
../../../../v8/src/execution/execution.cc:538:10: 0x1c2ad7c in CallScript (../../../../v8/src/execution/execution.cc)
../../../../v8/src/api/api.cc:2272:7: 0xd68bed in Run (../../../../v8/src/api/api.cc)
/home/pierre/prs/brwsrcr/jsruntime-lib/vendor/zig-v8/src/binding.cpp:414:54: 0xca5423 in v8__Script__Run (/home/pierre/prs/brwsrcr/jsruntime-lib/vendor/zig-v8/src/binding.cpp)
/home/pierre/wrk/browsercore/vendor/jsruntime-lib/vendor/zig-v8/src/v8.zig:1679:30: 0xafb75b in run (test)
if (c.v8__Script__Run(self.handle, ctx.handle)) |value| {
^
/home/pierre/wrk/browsercore/vendor/jsruntime-lib/src/engines/v8/v8.zig:449:28: 0xafc2b5 in exec (test)
const res = scr.run(context) catch {
^
/home/pierre/wrk/browsercore/vendor/jsruntime-lib/src/engines/v8/v8.zig:328:21: 0xac0a87 in run (test)
try res.exec(alloc, script, name, self.isolate, self.context.?, try_catch);
^
/home/pierre/wrk/browsercore/vendor/jsruntime-lib/src/tests/test_utils.zig:67:23: 0xac0417 in checkCases (test)
try js_env.run(fba_alloc, case.src, name, &res, &cbk_res);
^
/home/pierre/wrk/browsercore/src/dom/document.zig:289:19: 0xac1adc in testExecFn__anon_97462 (test)
try checkCases(js_env, &createProcessingInstruction);
^
/home/pierre/wrk/browsercore/src/run_tests.zig:47:15: 0xac311a in testExecFn__anon_97444 (test)
try execFn(alloc, js_env, apis);
^
/home/pierre/wrk/browsercore/src/run_tests.zig:69:23: 0xad069c in testsAllExecFn__anon_97442 (test)
try testExecFn(alloc, js_env, apis, testFn);
^
/home/pierre/wrk/browsercore/vendor/jsruntime-lib/src/engine.zig:47:18: 0xad0dac in loadEnv__anon_97274 (test)
try ctxExecFn(alloc, &js_env, apis);
^
/home/pierre/wrk/browsercore/src/run_tests.zig:90:26: 0xad20e0 in test_0 (test)
try jsruntime.loadEnv(&arena_alloc, testsAllExecFn, apis);
^
/usr/local/zig-0.12.0-dev.1773+8a8fd47d2/lib/test_runner.zig:101:29: 0xb056d4 in mainServer (test)
test_fn.func() catch |err| switch (err) {
^
/usr/local/zig-0.12.0-dev.1773+8a8fd47d2/lib/test_runner.zig:34:26: 0xad2e5e in main (test)
return mainServer() catch @panic("internal test runner failure");
^
/usr/local/zig-0.12.0-dev.1773+8a8fd47d2/lib/std/start.zig:575:22: 0xad2964 in main (test)
root.main();
^
run test: error: while executing test 'test_0', the following command terminated with signal 6 (expected exited with code 0):
/home/pierre/wrk/browsercore/zig-cache/o/f87da788c5a369e80c4398bdaf8ba6c0/test --listen=-
Build Summary: 2/4 steps succeeded; 1 failed; 1/1 tests passed (disable with --summary none)
test transitive failure
└─ run test failure
error: the following build command failed with exit code 1:
/home/pierre/wrk/browsercore/zig-cache/o/098e1df36c28355b4454108f4c97bef1/build /usr/local/zig-0.12.0-dev.1773+8a8fd47d2/zig /home/pierre/wrk/browsercore /home/pierre/wrk/browsercore/zig-cache /home/pierre/.cache/zig --seed 0x49e15c3 test -Dengine=v8
Test ERROR
make: *** [Makefile:86: test] Error 1