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

51 lines
1.3 KiB
Plaintext

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