File tree Expand file tree Collapse file tree 2 files changed +23
-2
lines changed
Expand file tree Collapse file tree 2 files changed +23
-2
lines changed Original file line number Diff line number Diff line change @@ -2447,7 +2447,7 @@ parse_switch_statement (void)
24472447{
24482448 assert_keyword (KW_SWITCH);
24492449
2450- const jsp_operand_t switch_expr = parse_expression_inside_parens ();
2450+ const jsp_operand_t switch_expr = dump_assignment_of_lhs_if_literal ( parse_expression_inside_parens () );
24512451 token_after_newlines_must_be (TOK_OPEN_BRACE);
24522452
24532453 start_dumping_case_clauses ();
@@ -2529,7 +2529,6 @@ parse_switch_statement (void)
25292529 }
25302530
25312531 current_token_must_be (TOK_CLOSE_BRACE);
2532- skip_token ();
25332532
25342533 jsp_label_rewrite_jumps_and_pop (&label,
25352534 serializer_get_current_instr_counter ());
Original file line number Diff line number Diff line change 1+ // Copyright 2015 Samsung Electronics Co., Ltd.
2+ // Copyright 2015 University of Szeged.
3+ //
4+ // Licensed under the Apache License, Version 2.0 (the "License");
5+ // you may not use this file except in compliance with the License.
6+ // You may obtain a copy of the License at
7+ //
8+ // http://www.apache.org/licenses/LICENSE-2.0
9+ //
10+ // Unless required by applicable law or agreed to in writing, software
11+ // distributed under the License is distributed on an "AS IS" BASIS
12+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+ // See the License for the specific language governing permissions and
14+ // limitations under the License.
15+
16+ try {
17+ eval ( "switch(foo){} {}" ) ;
18+ assert ( false ) ;
19+ } catch ( e ) {
20+ assert ( e instanceof ReferenceError ) ;
21+ }
22+
You can’t perform that action at this time.
0 commit comments