parser-declaration-in-single-statement-context.js 293 B

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