File tree Expand file tree Collapse file tree 3 files changed +22
-2
lines changed
Expand file tree Collapse file tree 3 files changed +22
-2
lines changed Original file line number Diff line number Diff line change @@ -842,8 +842,9 @@ parser_parse_while_statement_end (parser_context_t *context_p) /**< context */
842842 parser_emit_cbc_backward_branch (context_p , (uint16_t ) opcode , while_statement .start_offset );
843843 parser_set_breaks_to_current_position (context_p , loop .branch_list_p );
844844
845+ /* Calling scanner_seek is unnecessary because all
846+ * info blocks inside the while statement should be processed. */
845847 scanner_set_location (context_p , & location );
846- scanner_seek (context_p );
847848 context_p -> token = current_token ;
848849} /* parser_parse_while_statement_end */
849850
@@ -1186,8 +1187,9 @@ parser_parse_for_statement_end (parser_context_t *context_p) /**< context */
11861187 parser_emit_cbc_backward_branch (context_p , (uint16_t ) opcode , for_statement .start_offset );
11871188 parser_set_breaks_to_current_position (context_p , loop .branch_list_p );
11881189
1190+ /* Calling scanner_seek is unnecessary because all
1191+ * info blocks inside the for statement should be processed. */
11891192 scanner_set_location (context_p , & location );
1190- scanner_seek (context_p );
11911193 context_p -> token = current_token ;
11921194} /* parser_parse_for_statement_end */
11931195
Original file line number Diff line number Diff line change 1+ // Copyright JS Foundation and other contributors, http://js.foundation
2+ //
3+ // Licensed under the Apache License, Version 2.0 (the "License");
4+ // you may not use this file except in compliance with the License.
5+ // You may obtain a copy of the License at
6+ //
7+ // http://www.apache.org/licenses/LICENSE-2.0
8+ //
9+ // Unless required by applicable law or agreed to in writing, software
10+ // distributed under the License is distributed on an "AS IS" BASIS
11+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+ // See the License for the specific language governing permissions and
13+ // limitations under the License.
14+
15+ switch ( $ ) { case $ : for ( ; ; ) ; case $ :}
Original file line number Diff line number Diff line change @@ -103,3 +103,6 @@ switch ("var") {
103103}
104104
105105assert ( flow === '123a4' ) ;
106+
107+ switch ( 0 ) { case 0 : for ( ; false ; ) ; case 1 : }
108+ switch ( 0 ) { case 0 : while ( false ) ; case 1 : }
You can’t perform that action at this time.
0 commit comments