mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-25 02:40:49 +00:00
LibJS: Check for exception after executing (do)while test expression
Otherwise we crash the interpreter when an exception is thrown during
evaluation of the while or do/while test expression - which is easily
caused by a ReferenceError - e.g.:
while (someUndefinedVariable) {
// ...
}
This commit is contained in:
committed by
Andreas Kling
parent
a19d8aade4
commit
82ac936a9d
@@ -17,3 +17,9 @@ test("does not loop when initially false", () => {
|
||||
expect().fail();
|
||||
}
|
||||
});
|
||||
|
||||
test("exception in test expression", () => {
|
||||
expect(() => {
|
||||
while (foo);
|
||||
}).toThrow(ReferenceError);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user