69 lines
1.1 KiB
TypeScript
69 lines
1.1 KiB
TypeScript
//// [invalidDoWhileContinueStatements.ts]
|
|
// All errors
|
|
|
|
// naked continue not allowed
|
|
continue;
|
|
|
|
// non-existent label
|
|
ONE:
|
|
do continue TWO; while (true)
|
|
|
|
// continue from inside function
|
|
TWO:
|
|
do {
|
|
var x = () => {
|
|
continue TWO;
|
|
}
|
|
}while (true)
|
|
|
|
THREE:
|
|
do {
|
|
var fn = function () {
|
|
continue THREE;
|
|
}
|
|
}while (true)
|
|
|
|
// continue forward
|
|
do {
|
|
continue FIVE;
|
|
FIVE:
|
|
do { } while (true)
|
|
}while (true)
|
|
|
|
// label on non-loop statement
|
|
NINE:
|
|
var y = 12;
|
|
|
|
do {
|
|
continue NINE;
|
|
}while (true)
|
|
|
|
//// [invalidDoWhileContinueStatements.js]
|
|
// All errors
|
|
// naked continue not allowed
|
|
continue;
|
|
// non-existent label
|
|
ONE: do
|
|
continue TWO;
|
|
while (true);
|
|
// continue from inside function
|
|
TWO: do {
|
|
var x = function () {
|
|
continue TWO;
|
|
};
|
|
} while (true);
|
|
THREE: do {
|
|
var fn = function () {
|
|
continue THREE;
|
|
};
|
|
} while (true);
|
|
// continue forward
|
|
do {
|
|
continue FIVE;
|
|
FIVE: do { } while (true);
|
|
} while (true);
|
|
// label on non-loop statement
|
|
NINE: var y = 12;
|
|
do {
|
|
continue NINE;
|
|
} while (true);
|