mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-06 08:36:15 +00:00
LibJS: Restrict toEval() failures to SyntaxError
We only use expect(...).toEval() / not.toEval() for checking syntax errors, where we obviously can't put the code in a regular function. For runtime errors we do exactly that, so toEval() should not fail - this allows us to use undefined identifiers in syntax tests.
This commit is contained in:
committed by
Andreas Kling
parent
3ec19ae4b6
commit
d278f61f4c
@@ -330,7 +330,7 @@ test("toThrowWithMessage", () => {
|
||||
// "eval" function
|
||||
test("toEval", () => {
|
||||
expect("let a = 1").toEval();
|
||||
expect("a < 1").not.toEval();
|
||||
expect("a < 1").toEval();
|
||||
expect("&&*^%#%@").not.toEval();
|
||||
expect("function foo() { return 1; }; return foo();").toEval();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user