Lines Matching refs:TestLocalThrows

59 function TestLocalThrows(str, expect) {  class
68 TestLocalThrows("if (true) let x;", SyntaxError);
69 TestLocalThrows("if (true) {} else let x;", SyntaxError);
70 TestLocalThrows("do let x; while (false)", SyntaxError);
71 TestLocalThrows("while (false) let x;", SyntaxError);
72 TestLocalThrows("label: let x;", SyntaxError);
73 TestLocalThrows("for (;false;) let x;", SyntaxError);
78 TestLocalThrows("if (true) const x = 1;", SyntaxError);
79 TestLocalThrows("if (true) {} else const x = 1;", SyntaxError);
80 TestLocalThrows("do const x = 1; while (false)", SyntaxError);
81 TestLocalThrows("while (false) const x = 1;", SyntaxError);
82 TestLocalThrows("label: const x = 1;", SyntaxError);
83 TestLocalThrows("for (;false;) const x = 1;", SyntaxError);
88 TestLocalThrows("const x;", SyntaxError);
89 TestLocalThrows("const x = 1, y;", SyntaxError);
90 TestLocalThrows("const x, y = 1;", SyntaxError);
93 TestLocalThrows("if (true) const x;", SyntaxError);
94 TestLocalThrows("if (true) {} else const x;", SyntaxError);
95 TestLocalThrows("do const x; while (false)", SyntaxError);
96 TestLocalThrows("while (false) const x;", SyntaxError);
97 TestLocalThrows("label: const x;", SyntaxError);
98 TestLocalThrows("for (;false;) const x;", SyntaxError);
99 TestLocalThrows("switch (true) { case true: const x; }", SyntaxError);
100 TestLocalThrows("switch (true) { default: const x; }", SyntaxError);
113 TestLocalThrows("if (true) class x { };", SyntaxError);
114 TestLocalThrows("if (true) {} else class x { };", SyntaxError);
115 TestLocalThrows("do class x { }; while (false)", SyntaxError);
116 TestLocalThrows("while (false) class x { };", SyntaxError);
117 TestLocalThrows("label: class x { };", SyntaxError);
118 TestLocalThrows("for (;false;) class x { };", SyntaxError);
123 TestLocalThrows("{ let f; var f; }");
124 TestLocalThrows("{ var f; let f; }");
125 TestLocalThrows("{ function f() {} let f; }");
126 TestLocalThrows("{ let f; function f() {} }");
127 TestLocalThrows("{ function f() {} var f; }");
128 TestLocalThrows("{ var f; function f() {} }");
129 TestLocalThrows("{ function f() {} class f {} }");
130 TestLocalThrows("{ class f {}; function f() {} }");
131 TestLocalThrows("{ function f() {} function f() {} }");
132 TestLocalThrows("function f() {} let f;");
133 TestLocalThrows("let f; function f() {}");
134 TestLocalThrows("function f() {} class f {}");
135 TestLocalThrows("class f {}; function f() {}");
167 TestLocalThrows("function f() { if (true) function g() {} }", SyntaxError);
168 TestLocalThrows("function f() { if (true) {} else function g() {} }", SyntaxError);
169 TestLocalThrows("function f() { do function g() {} while (false) }", SyntaxError);
170 TestLocalThrows("function f() { while (false) function g() {} }", SyntaxError);
171 TestLocalThrows("function f() { label: function g() {} }", SyntaxError);
172 TestLocalThrows("function f() { for (;false;) function g() {} }", SyntaxError);