Fix parse of nested switch statements.
JerryScript-DCO-1.0-Signed-off-by: Ruben Ayrapetyan r.ayrapetyan@samsung.com
This commit is contained in:
committed by
Evgeny Gavrin
parent
6e2733dbfd
commit
3d31bfec92
@@ -2340,9 +2340,9 @@ rewrite_default_clause (void)
|
|||||||
void
|
void
|
||||||
finish_dumping_case_clauses (void)
|
finish_dumping_case_clauses (void)
|
||||||
{
|
{
|
||||||
STACK_DROP (U8, 1);
|
|
||||||
STACK_DROP (case_clauses, STACK_SIZE (case_clauses) - STACK_TOP (U8));
|
STACK_DROP (case_clauses, STACK_SIZE (case_clauses) - STACK_TOP (U8));
|
||||||
STACK_DROP (U8, 1);
|
STACK_DROP (U8, 1);
|
||||||
|
STACK_DROP (U8, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -73,3 +73,25 @@ switch ("var") {
|
|||||||
}
|
}
|
||||||
|
|
||||||
assert (counter === 4);
|
assert (counter === 4);
|
||||||
|
|
||||||
|
var flow = '';
|
||||||
|
|
||||||
|
switch ("var") {
|
||||||
|
case "var":
|
||||||
|
flow += '1';
|
||||||
|
case "var1":
|
||||||
|
flow += '2';
|
||||||
|
case "var2":
|
||||||
|
flow += '3';
|
||||||
|
switch (flow) {
|
||||||
|
case '123':
|
||||||
|
flow += 'a';
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
flow += 'b';
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
flow += '4';
|
||||||
|
}
|
||||||
|
|
||||||
|
assert (flow === '123a4');
|
||||||
|
|||||||
Reference in New Issue
Block a user