File tree Expand file tree Collapse file tree 2 files changed +13
-7
lines changed Expand file tree Collapse file tree 2 files changed +13
-7
lines changed Original file line number Diff line number Diff line change @@ -2091,7 +2091,8 @@ parse_switch_statement (void)
2091
2091
{
2092
2092
token_after_newlines_must_be (TOK_COLON);
2093
2093
skip_newlines ();
2094
- if (is_keyword (KW_CASE) || is_keyword (KW_DEFAULT))
2094
+ rewrite_default_clause ();
2095
+ if (is_keyword (KW_CASE))
2095
2096
{
2096
2097
continue ;
2097
2098
}
@@ -2104,12 +2105,6 @@ parse_switch_statement (void)
2104
2105
skip_token ();
2105
2106
pop_nesting (NESTING_SWITCH);
2106
2107
2107
- // Finally, dump 'finally' jump
2108
- if (was_default)
2109
- {
2110
- rewrite_default_clause ();
2111
- }
2112
-
2113
2108
dumper_set_break_target ();
2114
2109
rewrite_breaks ();
2115
2110
finish_dumping_case_clauses ();
Original file line number Diff line number Diff line change @@ -48,6 +48,17 @@ switch (a) {
48
48
assert ( 0 ) ;
49
49
}
50
50
51
+ executed_case = '' ;
52
+ switch ( a ) {
53
+ default :
54
+ executed_case = 'default' ;
55
+ break ;
56
+ case 2 :
57
+ executed_case = 'case 2' ;
58
+ break ;
59
+ }
60
+ assert ( executed_case === 'default' ) ;
61
+
51
62
var counter = 0 ;
52
63
53
64
switch ( "var" ) {
You can’t perform that action at this time.
0 commit comments