TypeScript/tests/baselines/reference/invalidDoWhileContinueStatements.errors.txt

51 lines
1.3 KiB
Plaintext

==== tests/cases/conformance/statements/continueStatements/invalidDoWhileContinueStatements.ts (6 errors) ====
// All errors
// naked continue not allowed
continue;
~~~~~~~~~
!!! A 'continue' statement can only be used within an enclosing iteration statement.
// non-existent label
ONE:
do continue TWO; while (true)
~~~~~~~~~~~~~
!!! A 'continue' statement can only jump to a label of an enclosing iteration statement.
// continue from inside function
TWO:
do {
var x = () => {
continue TWO;
~~~~~~~~~~~~~
!!! Jump target cannot cross function boundary.
}
}while (true)
THREE:
do {
var fn = function () {
continue THREE;
~~~~~~~~~~~~~~~
!!! Jump target cannot cross function boundary.
}
}while (true)
// continue forward
do {
continue FIVE;
~~~~~~~~~~~~~~
!!! A 'continue' statement can only jump to a label of an enclosing iteration statement.
FIVE:
do { } while (true)
}while (true)
// label on non-loop statement
NINE:
var y = 12;
do {
continue NINE;
~~~~~~~~~~~~~~
!!! A 'continue' statement can only jump to a label of an enclosing iteration statement.
}while (true)