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

50 lines
1.3 KiB
Plaintext

==== tests/cases/conformance/statements/continueStatements/invalidForContinueStatements.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:
for(;;) continue TWO;
~~~~~~~~~~~~~
!!! A 'continue' statement can only jump to a label of an enclosing iteration statement.
// continue from inside function
TWO:
for(;;) {
var x = () => {
continue TWO;
~~~~~~~~~~~~~
!!! Jump target cannot cross function boundary.
}
}
THREE:
for(;;) {
var fn = function () {
continue THREE;
~~~~~~~~~~~~~~~
!!! Jump target cannot cross function boundary.
}
}
// continue forward
for(;;) {
continue FIVE;
~~~~~~~~~~~~~~
!!! A 'continue' statement can only jump to a label of an enclosing iteration statement.
FIVE:
for (; ;) { }
}
// label on non-loop statement
NINE:
var y = 12;
for(;;) {
continue NINE;
~~~~~~~~~~~~~~
!!! A 'continue' statement can only jump to a label of an enclosing iteration statement.
}