mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
47 lines
852 B
Plaintext
47 lines
852 B
Plaintext
//// [tests/cases/conformance/statements/continueStatements/invalidWhileContinueStatements.ts] ////
|
|
|
|
=== invalidWhileContinueStatements.ts ===
|
|
// All errors
|
|
|
|
// naked continue not allowed
|
|
continue;
|
|
|
|
// non-existent label
|
|
ONE:
|
|
while (true) continue TWO;
|
|
|
|
// continue from inside function
|
|
TWO:
|
|
while (true){
|
|
var x = () => {
|
|
>x : Symbol(x, Decl(invalidWhileContinueStatements.ts, 12, 7))
|
|
|
|
continue TWO;
|
|
}
|
|
}
|
|
|
|
THREE:
|
|
while (true) {
|
|
var fn = function () {
|
|
>fn : Symbol(fn, Decl(invalidWhileContinueStatements.ts, 19, 7))
|
|
|
|
continue THREE;
|
|
}
|
|
}
|
|
|
|
// continue forward
|
|
while (true) {
|
|
continue FIVE;
|
|
FIVE:
|
|
while (true) { }
|
|
}
|
|
|
|
// label on non-loop statement
|
|
NINE:
|
|
var y = 12;
|
|
>y : Symbol(y, Decl(invalidWhileContinueStatements.ts, 33, 3))
|
|
|
|
while (true) {
|
|
continue NINE;
|
|
}
|