mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 04:09:13 +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:
parent
3ec19ae4b6
commit
d278f61f4c
Notes:
sideshowbarker
2024-07-19 01:41:03 +09:00
Author: https://github.com/linusg
Commit: d278f61f4c
Pull-request: https://github.com/SerenityOS/serenity/pull/3863
Reviewed-by: https://github.com/awesomekling
2 changed files with 2 additions and 2 deletions
|
@ -287,7 +287,7 @@ class ExpectationError extends Error {
|
|||
|
||||
let threw = false;
|
||||
try {
|
||||
new Function(this.target)();
|
||||
new Function(this.target);
|
||||
} catch (e) {
|
||||
threw = true;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue