mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-02 14:19:48 +00:00
LibJS: Use assertNotReached() in tests
This commit is contained in:
parent
92a9fe0e49
commit
b9415dc0e9
Notes:
sideshowbarker
2024-07-19 07:37:53 +09:00
Author: https://github.com/linusg
Commit: b9415dc0e9
Pull-request: https://github.com/SerenityOS/serenity/pull/1782
8 changed files with 36 additions and 27 deletions
|
@ -1,11 +1,13 @@
|
|||
try {
|
||||
throw 1;
|
||||
assertNotReached();
|
||||
} catch (e) {
|
||||
assert(e === 1);
|
||||
}
|
||||
|
||||
try {
|
||||
throw [99];
|
||||
assertNotReached();
|
||||
} catch (e) {
|
||||
assert(typeof e === "object");
|
||||
assert(e.length === 1);
|
||||
|
@ -13,10 +15,12 @@ try {
|
|||
|
||||
function foo() {
|
||||
throw "hello";
|
||||
assertNotReached();
|
||||
}
|
||||
|
||||
try {
|
||||
foo();
|
||||
assertNotReached();
|
||||
} catch (e) {
|
||||
assert(e === "hello");
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue