blob: e8a8b6c72162182dd7d244989d49f2d3acf5e9df [file] [log] [blame]
Verify that invalid continue and break statements are handled correctly
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS L:{true;break L;false} is true
PASS if (0) { L:{ break; } } threw exception SyntaxError: 'break' is only valid inside a switch or loop statement..
PASS if (0) { L:{ continue L; } } threw exception SyntaxError: Cannot continue to the label 'L' as it is not targeting a loop..
PASS if (0) { L:{ continue; } } threw exception SyntaxError: 'continue' is only valid inside a loop statement..
PASS if (0) { switch (1) { case 1: continue; } } threw exception SyntaxError: 'continue' is only valid inside a loop statement..
PASS A:L:{true;break L;false} is true
PASS if (0) { A:L:{ break; } } threw exception SyntaxError: 'break' is only valid inside a switch or loop statement..
PASS if (0) { A:L:{ continue L; } } threw exception SyntaxError: Cannot continue to the label 'L' as it is not targeting a loop..
PASS if (0) { A:L:{ continue; } } threw exception SyntaxError: 'continue' is only valid inside a loop statement..
PASS L:A:{true;break L;false} is true
PASS if (0) { L:A:{ break; } } threw exception SyntaxError: 'break' is only valid inside a switch or loop statement..
PASS if (0) { L:A:{ continue L; } } threw exception SyntaxError: Cannot continue to the label 'L' as it is not targeting a loop..
PASS if (0) { L:A:{ continue; } } threw exception SyntaxError: 'continue' is only valid inside a loop statement..
PASS if(0){ L:for(;;) continue L; } is undefined.
PASS if(0){ L:A:for(;;) continue L; } is undefined.
PASS if(0){ A:L:for(;;) continue L; } is undefined.
PASS if(0){ A:for(;;) L:continue L; } threw exception SyntaxError: Cannot continue to the label 'L' as it is not targeting a loop..
PASS if(0){ L:for(;;) A:continue L; } is undefined.
PASS if(0){ L:do continue L; while(0); } is undefined.
PASS if(0){ L:A:do continue L; while(0); } is undefined.
PASS if(0){ A:L:do continue L; while(0);} is undefined.
PASS if(0){ A:do L:continue L; while(0); } threw exception SyntaxError: Cannot continue to the label 'L' as it is not targeting a loop..
PASS if(0){ L:do A:continue L; while(0); } is undefined.
PASS if(0){ L:while(0) continue L; } is undefined.
PASS if(0){ L:A:while(0) continue L; } is undefined.
PASS if(0){ A:L:while(0) continue L; } is undefined.
PASS if(0){ A:while(0) L:continue L; } threw exception SyntaxError: Cannot continue to the label 'L' as it is not targeting a loop..
PASS if(0){ L:while(0) A:continue L; } is undefined.
PASS successfullyParsed is true
TEST COMPLETE