mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-01 03:57:15 +02:00
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:
committed by
Shannon Booth
parent
a4051cca11
commit
2ca45fba6a
Notes:
github-actions[bot]
2026-01-07 23:56:56 +00:00
Author: https://github.com/CountBleck Commit: https://github.com/LadybirdBrowser/ladybird/commit/2ca45fba6a0 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/7307 Reviewed-by: https://github.com/shannonbooth ✅
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user