LibWeb: Update structured-clone-battery-of-tests to include Error#cause

This just re-imports the file via WPT.sh to match what is currently
present in WPT. This file is used by...
https://wpt.live/html/infrastructure/safe-passing-of-structured-data/messagechannel.any.html
...as well as other WPT tests.
This commit is contained in:
CountBleck
2026-01-02 21:36:54 -08:00
committed by Shannon Booth
parent a4051cca11
commit 2ca45fba6a
Notes: github-actions[bot] 2026-01-07 23:56:56 +00:00

View File

@@ -260,6 +260,7 @@ function compare_Error(actual, input) {
assert_equals(actual.name, input.name, "Checking name");
assert_equals(actual.hasOwnProperty("message"), input.hasOwnProperty("message"), "Checking message existence");
assert_equals(actual.message, input.message, "Checking message");
assert_equals(actual.cause, input.cause, "Checking cause");
assert_equals(actual.foo, undefined, "Checking for absence of custom property");
}
@@ -269,7 +270,7 @@ const errorConstructors = [Error, EvalError, RangeError, ReferenceError,
SyntaxError, TypeError, URIError];
for (const constructor of errorConstructors) {
check(`${constructor.name} object`, () => {
let error = new constructor("Error message here");
let error = new constructor("Error message here", { cause: "my cause" });
error.foo = "testing";
return error;
}, compare_Error);