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