mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-27 03:37:53 +00:00
LibJS: Use assertNotReached() in tests
This commit is contained in:
committed by
Andreas Kling
parent
92a9fe0e49
commit
b9415dc0e9
@@ -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");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user