Files
ladybird/Tests/LibJS/Runtime/parser-declaration-in-single-statement-context.js
2026-01-22 07:46:48 -05:00

7 lines
293 B
JavaScript

test("Declaration in single-statement context is a syntax error", () => {
expect("if (0) const foo = 1").not.toEval();
expect("while (0) function foo() {}").not.toEval();
expect("for (var 0;;) class foo() {}").not.toEval();
expect("do let foo = 1 while (0)").not.toEval();
});