mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 03:07:44 +00:00
LibJS: Implement the Error Cause proposal
Currently stage 3. https://github.com/tc39/proposal-error-cause
This commit is contained in:
parent
8d77a3297a
commit
862ba64037
11 changed files with 130 additions and 42 deletions
|
@ -56,4 +56,11 @@ describe("normal behavior", () => {
|
|||
}).errors
|
||||
).toEqual(errors);
|
||||
});
|
||||
|
||||
test("supports options object with cause", () => {
|
||||
const cause = new Error();
|
||||
const error = new AggregateError([], "test", { cause });
|
||||
expect(error.hasOwnProperty("cause")).toBeTrue();
|
||||
expect(error.cause).toBe(cause);
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue