59 lines
No EOL
2.4 KiB
Text
59 lines
No EOL
2.4 KiB
Text
tests/cases/conformance/statements/breakStatements/invalidDoWhileBreakStatements.ts(4,1): error TS1105: A 'break' statement can only be used within an enclosing iteration or switch statement.
|
|
tests/cases/conformance/statements/breakStatements/invalidDoWhileBreakStatements.ts(8,4): error TS1116: A 'break' statement can only jump to a label of an enclosing statement.
|
|
tests/cases/conformance/statements/breakStatements/invalidDoWhileBreakStatements.ts(14,9): error TS1107: Jump target cannot cross function boundary.
|
|
tests/cases/conformance/statements/breakStatements/invalidDoWhileBreakStatements.ts(21,9): error TS1107: Jump target cannot cross function boundary.
|
|
tests/cases/conformance/statements/breakStatements/invalidDoWhileBreakStatements.ts(27,5): error TS1116: A 'break' statement can only jump to a label of an enclosing statement.
|
|
tests/cases/conformance/statements/breakStatements/invalidDoWhileBreakStatements.ts(37,5): error TS1116: A 'break' statement can only jump to a label of an enclosing statement.
|
|
|
|
|
|
==== tests/cases/conformance/statements/breakStatements/invalidDoWhileBreakStatements.ts (6 errors) ====
|
|
// All errors
|
|
|
|
// naked break not allowed
|
|
break;
|
|
~~~~~~
|
|
!!! error TS1105: A 'break' statement can only be used within an enclosing iteration or switch statement.
|
|
|
|
// non-existent label
|
|
ONE:
|
|
do break TWO; while (true)
|
|
~~~~~~~~~~
|
|
!!! error TS1116: A 'break' statement can only jump to a label of an enclosing statement.
|
|
|
|
// break from inside function
|
|
TWO:
|
|
do {
|
|
var x = () => {
|
|
break TWO;
|
|
~~~~~~~~~~
|
|
!!! error TS1107: Jump target cannot cross function boundary.
|
|
}
|
|
}while (true)
|
|
|
|
THREE:
|
|
do {
|
|
var fn = function () {
|
|
break THREE;
|
|
~~~~~~~~~~~~
|
|
!!! error TS1107: Jump target cannot cross function boundary.
|
|
}
|
|
}while (true)
|
|
|
|
// break forward
|
|
do {
|
|
break FIVE;
|
|
~~~~~~~~~~~
|
|
!!! error TS1116: A 'break' statement can only jump to a label of an enclosing statement.
|
|
FIVE:
|
|
do { } while (true)
|
|
}while (true)
|
|
|
|
// label on non-loop statement
|
|
NINE:
|
|
var y = 12;
|
|
|
|
do {
|
|
break NINE;
|
|
~~~~~~~~~~~
|
|
!!! error TS1116: A 'break' statement can only jump to a label of an enclosing statement.
|
|
}while (true) |