mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 14:18:12 +00:00
LibJS: Throw SyntaxError in eval() when parser has error(s)
This commit is contained in:
parent
01a49dda85
commit
d6239b691f
2 changed files with 15 additions and 0 deletions
|
@ -8,3 +8,12 @@ test("basic eval() functionality", () => {
|
|||
}
|
||||
expect(foo(7)).toBe(12);
|
||||
});
|
||||
|
||||
test("syntax error", () => {
|
||||
expect(() => {
|
||||
eval("{");
|
||||
}).toThrowWithMessage(
|
||||
SyntaxError,
|
||||
"Unexpected token Eof. Expected CurlyClose (line: 1, column: 2)"
|
||||
);
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue