1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-14 17:54:57 +00:00

LibJS: Require initializer for 'const' variable declaration

This commit is contained in:
Linus Groh 2020-10-30 19:08:45 +00:00 committed by Andreas Kling
parent 812e3ecedd
commit 563d3c8055
3 changed files with 21 additions and 14 deletions

View file

@ -0,0 +1,5 @@
test("missing initializer in 'const' variable declaration is syntax error", () => {
expect("const foo").not.toEval();
expect("const foo = 1, bar").not.toEval();
expect("const foo = 1, bar, baz = 2").not.toEval();
});