Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/compiler/diagnosticMessages.json
Original file line number Diff line number Diff line change
Expand Up @@ -1111,7 +1111,7 @@
"category": "Error",
"code": 1343
},
"'A label is not allowed here.": {
"A label is not allowed here.": {
"category": "Error",
"code": 1344
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
ambientWithStatements.ts(2,5): error TS1036: Statements are not allowed in ambient contexts.
ambientWithStatements.ts(3,5): error TS1104: A 'continue' statement can only be used within an enclosing iteration statement.
ambientWithStatements.ts(10,5): error TS1344: 'A label is not allowed here.
ambientWithStatements.ts(10,5): error TS1344: A label is not allowed here.
ambientWithStatements.ts(11,5): error TS1108: A 'return' statement can only be used within a function body.
ambientWithStatements.ts(25,5): error TS1101: 'with' statements are not allowed in strict mode.
ambientWithStatements.ts(25,5): error TS2410: The 'with' statement is not supported. All symbols in a 'with' block will have type 'any'.
Expand All @@ -22,7 +22,7 @@ ambientWithStatements.ts(25,5): error TS2410: The 'with' statement is not suppor
1;
L: var y;
~
!!! error TS1344: 'A label is not allowed here.
!!! error TS1344: A label is not allowed here.
return;
~~~~~~
!!! error TS1108: A 'return' statement can only be used within a function body.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ constDeclarations-invalidContexts.ts(15,1): error TS1101: 'with' statements are
constDeclarations-invalidContexts.ts(15,1): error TS2410: The 'with' statement is not supported. All symbols in a 'with' block will have type 'any'.
constDeclarations-invalidContexts.ts(19,5): error TS1156: 'const' declarations can only be declared inside a block.
constDeclarations-invalidContexts.ts(22,5): error TS1156: 'const' declarations can only be declared inside a block.
constDeclarations-invalidContexts.ts(25,5): error TS1344: 'A label is not allowed here.
constDeclarations-invalidContexts.ts(25,5): error TS1344: A label is not allowed here.
constDeclarations-invalidContexts.ts(25,12): error TS1156: 'const' declarations can only be declared inside a block.
constDeclarations-invalidContexts.ts(28,21): error TS1344: 'A label is not allowed here.
constDeclarations-invalidContexts.ts(28,21): error TS1344: A label is not allowed here.
constDeclarations-invalidContexts.ts(28,29): error TS1156: 'const' declarations can only be declared inside a block.


Expand Down Expand Up @@ -55,14 +55,14 @@ constDeclarations-invalidContexts.ts(28,29): error TS1156: 'const' declarations
if (true)
label: const c8 = 0;
~~~~~
!!! error TS1344: 'A label is not allowed here.
!!! error TS1344: A label is not allowed here.
~~~~~~~~~~~~~
!!! error TS1156: 'const' declarations can only be declared inside a block.

while (false)
label2: label3: label4: const c9 = 0;
~~~~~~
!!! error TS1344: 'A label is not allowed here.
!!! error TS1344: A label is not allowed here.
~~~~~~~~~~~~~
!!! error TS1156: 'const' declarations can only be declared inside a block.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
constDeclarations-scopes.ts(27,1): error TS1101: 'with' statements are not allowed in strict mode.
constDeclarations-scopes.ts(27,1): error TS2410: The 'with' statement is not supported. All symbols in a 'with' block will have type 'any'.
constDeclarations-scopes.ts(43,5): error TS1344: 'A label is not allowed here.
constDeclarations-scopes.ts(48,21): error TS1344: 'A label is not allowed here.
constDeclarations-scopes.ts(43,5): error TS1344: A label is not allowed here.
constDeclarations-scopes.ts(48,21): error TS1344: A label is not allowed here.


==== constDeclarations-scopes.ts (4 errors) ====
Expand Down Expand Up @@ -53,14 +53,14 @@ constDeclarations-scopes.ts(48,21): error TS1344: 'A label is not allowed here.
if (true) {
label: const c = 0;
~~~~~
!!! error TS1344: 'A label is not allowed here.
!!! error TS1344: A label is not allowed here.
n = c;
}

while (false) {
label2: label3: label4: const c = 0;
~~~~~~
!!! error TS1344: 'A label is not allowed here.
!!! error TS1344: A label is not allowed here.
n = c;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
constDeclarations-validContexts.ts(18,1): error TS1101: 'with' statements are not allowed in strict mode.
constDeclarations-validContexts.ts(18,1): error TS2410: The 'with' statement is not supported. All symbols in a 'with' block will have type 'any'.
constDeclarations-validContexts.ts(31,5): error TS1344: 'A label is not allowed here.
constDeclarations-validContexts.ts(35,21): error TS1344: 'A label is not allowed here.
constDeclarations-validContexts.ts(64,9): error TS1344: 'A label is not allowed here.
constDeclarations-validContexts.ts(31,5): error TS1344: A label is not allowed here.
constDeclarations-validContexts.ts(35,21): error TS1344: A label is not allowed here.
constDeclarations-validContexts.ts(64,9): error TS1344: A label is not allowed here.


==== constDeclarations-validContexts.ts (5 errors) ====
Expand Down Expand Up @@ -42,13 +42,13 @@ constDeclarations-validContexts.ts(64,9): error TS1344: 'A label is not allowed
if (true) {
label: const c8 = 0;
~~~~~
!!! error TS1344: 'A label is not allowed here.
!!! error TS1344: A label is not allowed here.
}

while (false) {
label2: label3: label4: const c9 = 0;
~~~~~~
!!! error TS1344: 'A label is not allowed here.
!!! error TS1344: A label is not allowed here.
}

// Try/catch/finally
Expand Down Expand Up @@ -79,7 +79,7 @@ constDeclarations-validContexts.ts(64,9): error TS1344: 'A label is not allowed
const c16 = 0
label17: const c17 = 0;
~~~~~~~
!!! error TS1344: 'A label is not allowed here.
!!! error TS1344: A label is not allowed here.
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ invalidDoWhileBreakStatements.ts(8,4): error TS1116: A 'break' statement can onl
invalidDoWhileBreakStatements.ts(14,9): error TS1107: Jump target cannot cross function boundary.
invalidDoWhileBreakStatements.ts(21,9): error TS1107: Jump target cannot cross function boundary.
invalidDoWhileBreakStatements.ts(27,5): error TS1116: A 'break' statement can only jump to a label of an enclosing statement.
invalidDoWhileBreakStatements.ts(33,1): error TS1344: 'A label is not allowed here.
invalidDoWhileBreakStatements.ts(33,1): error TS1344: A label is not allowed here.
invalidDoWhileBreakStatements.ts(37,5): error TS1116: A 'break' statement can only jump to a label of an enclosing statement.


Expand Down Expand Up @@ -52,7 +52,7 @@ invalidDoWhileBreakStatements.ts(37,5): error TS1116: A 'break' statement can on
// label on non-loop statement
NINE:
~~~~
!!! error TS1344: 'A label is not allowed here.
!!! error TS1344: A label is not allowed here.
var y = 12;

do {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ invalidDoWhileContinueStatements.ts(8,4): error TS1115: A 'continue' statement c
invalidDoWhileContinueStatements.ts(14,9): error TS1107: Jump target cannot cross function boundary.
invalidDoWhileContinueStatements.ts(21,9): error TS1107: Jump target cannot cross function boundary.
invalidDoWhileContinueStatements.ts(27,5): error TS1115: A 'continue' statement can only jump to a label of an enclosing iteration statement.
invalidDoWhileContinueStatements.ts(33,1): error TS1344: 'A label is not allowed here.
invalidDoWhileContinueStatements.ts(33,1): error TS1344: A label is not allowed here.
invalidDoWhileContinueStatements.ts(37,5): error TS1115: A 'continue' statement can only jump to a label of an enclosing iteration statement.


Expand Down Expand Up @@ -52,7 +52,7 @@ invalidDoWhileContinueStatements.ts(37,5): error TS1115: A 'continue' statement
// label on non-loop statement
NINE:
~~~~
!!! error TS1344: 'A label is not allowed here.
!!! error TS1344: A label is not allowed here.
var y = 12;

do {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ invalidForBreakStatements.ts(8,9): error TS1116: A 'break' statement can only ju
invalidForBreakStatements.ts(14,9): error TS1107: Jump target cannot cross function boundary.
invalidForBreakStatements.ts(21,9): error TS1107: Jump target cannot cross function boundary.
invalidForBreakStatements.ts(27,5): error TS1116: A 'break' statement can only jump to a label of an enclosing statement.
invalidForBreakStatements.ts(32,1): error TS1344: 'A label is not allowed here.
invalidForBreakStatements.ts(32,1): error TS1344: A label is not allowed here.
invalidForBreakStatements.ts(36,5): error TS1116: A 'break' statement can only jump to a label of an enclosing statement.


Expand Down Expand Up @@ -51,7 +51,7 @@ invalidForBreakStatements.ts(36,5): error TS1116: A 'break' statement can only j
// label on non-loop statement
NINE:
~~~~
!!! error TS1344: 'A label is not allowed here.
!!! error TS1344: A label is not allowed here.
var y = 12;

for(;;) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ invalidForContinueStatements.ts(8,9): error TS1115: A 'continue' statement can o
invalidForContinueStatements.ts(14,9): error TS1107: Jump target cannot cross function boundary.
invalidForContinueStatements.ts(21,9): error TS1107: Jump target cannot cross function boundary.
invalidForContinueStatements.ts(27,5): error TS1115: A 'continue' statement can only jump to a label of an enclosing iteration statement.
invalidForContinueStatements.ts(32,1): error TS1344: 'A label is not allowed here.
invalidForContinueStatements.ts(32,1): error TS1344: A label is not allowed here.
invalidForContinueStatements.ts(36,5): error TS1115: A 'continue' statement can only jump to a label of an enclosing iteration statement.


Expand Down Expand Up @@ -51,7 +51,7 @@ invalidForContinueStatements.ts(36,5): error TS1115: A 'continue' statement can
// label on non-loop statement
NINE:
~~~~
!!! error TS1344: 'A label is not allowed here.
!!! error TS1344: A label is not allowed here.
var y = 12;

for(;;) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ invalidForInBreakStatements.ts(8,19): error TS1116: A 'break' statement can only
invalidForInBreakStatements.ts(14,9): error TS1107: Jump target cannot cross function boundary.
invalidForInBreakStatements.ts(21,9): error TS1107: Jump target cannot cross function boundary.
invalidForInBreakStatements.ts(27,5): error TS1116: A 'break' statement can only jump to a label of an enclosing statement.
invalidForInBreakStatements.ts(33,1): error TS1344: 'A label is not allowed here.
invalidForInBreakStatements.ts(33,1): error TS1344: A label is not allowed here.
invalidForInBreakStatements.ts(37,5): error TS1116: A 'break' statement can only jump to a label of an enclosing statement.


Expand Down Expand Up @@ -52,7 +52,7 @@ invalidForInBreakStatements.ts(37,5): error TS1116: A 'break' statement can only
// label on non-loop statement
NINE:
~~~~
!!! error TS1344: 'A label is not allowed here.
!!! error TS1344: A label is not allowed here.
var y = 12;

for (var x in {}) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ invalidForInContinueStatements.ts(8,19): error TS1115: A 'continue' statement ca
invalidForInContinueStatements.ts(14,9): error TS1107: Jump target cannot cross function boundary.
invalidForInContinueStatements.ts(21,9): error TS1107: Jump target cannot cross function boundary.
invalidForInContinueStatements.ts(27,5): error TS1115: A 'continue' statement can only jump to a label of an enclosing iteration statement.
invalidForInContinueStatements.ts(33,1): error TS1344: 'A label is not allowed here.
invalidForInContinueStatements.ts(33,1): error TS1344: A label is not allowed here.
invalidForInContinueStatements.ts(37,5): error TS1115: A 'continue' statement can only jump to a label of an enclosing iteration statement.


Expand Down Expand Up @@ -52,7 +52,7 @@ invalidForInContinueStatements.ts(37,5): error TS1115: A 'continue' statement ca
// label on non-loop statement
NINE:
~~~~
!!! error TS1344: 'A label is not allowed here.
!!! error TS1344: A label is not allowed here.
var y = 12;

for (var x in {}) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ invalidWhileBreakStatements.ts(8,14): error TS1116: A 'break' statement can only
invalidWhileBreakStatements.ts(14,9): error TS1107: Jump target cannot cross function boundary.
invalidWhileBreakStatements.ts(21,9): error TS1107: Jump target cannot cross function boundary.
invalidWhileBreakStatements.ts(27,5): error TS1116: A 'break' statement can only jump to a label of an enclosing statement.
invalidWhileBreakStatements.ts(33,1): error TS1344: 'A label is not allowed here.
invalidWhileBreakStatements.ts(33,1): error TS1344: A label is not allowed here.
invalidWhileBreakStatements.ts(37,5): error TS1116: A 'break' statement can only jump to a label of an enclosing statement.


Expand Down Expand Up @@ -52,7 +52,7 @@ invalidWhileBreakStatements.ts(37,5): error TS1116: A 'break' statement can only
// label on non-loop statement
NINE:
~~~~
!!! error TS1344: 'A label is not allowed here.
!!! error TS1344: A label is not allowed here.
var y = 12;

while (true) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ invalidWhileContinueStatements.ts(8,14): error TS1115: A 'continue' statement ca
invalidWhileContinueStatements.ts(14,9): error TS1107: Jump target cannot cross function boundary.
invalidWhileContinueStatements.ts(21,9): error TS1107: Jump target cannot cross function boundary.
invalidWhileContinueStatements.ts(27,5): error TS1115: A 'continue' statement can only jump to a label of an enclosing iteration statement.
invalidWhileContinueStatements.ts(33,1): error TS1344: 'A label is not allowed here.
invalidWhileContinueStatements.ts(33,1): error TS1344: A label is not allowed here.
invalidWhileContinueStatements.ts(37,5): error TS1115: A 'continue' statement can only jump to a label of an enclosing iteration statement.


Expand Down Expand Up @@ -52,7 +52,7 @@ invalidWhileContinueStatements.ts(37,5): error TS1115: A 'continue' statement ca
// label on non-loop statement
NINE:
~~~~
!!! error TS1344: 'A label is not allowed here.
!!! error TS1344: A label is not allowed here.
var y = 12;

while (true) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
a.js(3,9): error TS7029: Fallthrough case in switch.
a.js(16,5): error TS7027: Unreachable code detected.
a.js(19,1): error TS1344: 'A label is not allowed here.
a.js(19,1): error TS1344: A label is not allowed here.
a.js(19,1): error TS7028: Unused label.


Expand Down Expand Up @@ -29,6 +29,6 @@ a.js(19,1): error TS7028: Unused label.

label1: var x2 = 10;
~~~~~~
!!! error TS1344: 'A label is not allowed here.
!!! error TS1344: A label is not allowed here.
~~~~~~
!!! error TS7028: Unused label.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
labeledStatementDeclarationListInLoopNoCrash1.ts(3,3): error TS1344: 'A label is not allowed here.
labeledStatementDeclarationListInLoopNoCrash1.ts(3,3): error TS1344: A label is not allowed here.
labeledStatementDeclarationListInLoopNoCrash1.ts(3,11): error TS1123: Variable declaration list cannot be empty.


Expand All @@ -7,7 +7,7 @@ labeledStatementDeclarationListInLoopNoCrash1.ts(3,11): error TS1123: Variable d
var v0 = x;
foo: var;
~~~
!!! error TS1344: 'A label is not allowed here.
!!! error TS1344: A label is not allowed here.

!!! error TS1123: Variable declaration list cannot be empty.
(function() { return x + v0});
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
labeledStatementDeclarationListInLoopNoCrash2.ts(3,3): error TS1344: 'A label is not allowed here.
labeledStatementDeclarationListInLoopNoCrash2.ts(3,3): error TS1344: A label is not allowed here.


==== labeledStatementDeclarationListInLoopNoCrash2.ts (1 errors) ====
for (let x of []) {
var v0 = x;
foo: var y;
~~~
!!! error TS1344: 'A label is not allowed here.
!!! error TS1344: A label is not allowed here.
(function() { return x + v0});
}

Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ labeledStatementDeclarationListInLoopNoCrash3.ts(15,42): error TS1005: ')' expec
labeledStatementDeclarationListInLoopNoCrash3.ts(15,53): error TS2304: Cannot find name 'fontSize'.
labeledStatementDeclarationListInLoopNoCrash3.ts(15,61): error TS1005: ';' expected.
labeledStatementDeclarationListInLoopNoCrash3.ts(16,12): error TS1005: ';' expected.
labeledStatementDeclarationListInLoopNoCrash3.ts(16,12): error TS1344: 'A label is not allowed here.
labeledStatementDeclarationListInLoopNoCrash3.ts(16,12): error TS1344: A label is not allowed here.
labeledStatementDeclarationListInLoopNoCrash3.ts(16,23): error TS1134: Variable declaration expected.
labeledStatementDeclarationListInLoopNoCrash3.ts(16,38): error TS2592: Cannot find name '$'. Do you need to install type definitions for jQuery? Try `npm i --save-dev @types/jquery` and then add 'jquery' to the types field in your tsconfig.
labeledStatementDeclarationListInLoopNoCrash3.ts(16,39): error TS1005: ')' expected.
Expand Down Expand Up @@ -58,7 +58,7 @@ labeledStatementDeclarationListInLoopNoCrash3.ts(22,1): error TS1160: Unterminat
~~~~~~
!!! error TS1005: ';' expected.
~~~~~~
!!! error TS1344: 'A label is not allowed here.
!!! error TS1344: A label is not allowed here.
~
!!! error TS1134: Variable declaration expected.
~
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ labeledStatementDeclarationListInLoopNoCrash4.ts(13,42): error TS1005: ')' expec
labeledStatementDeclarationListInLoopNoCrash4.ts(13,53): error TS2304: Cannot find name 'fontSize'.
labeledStatementDeclarationListInLoopNoCrash4.ts(13,61): error TS1005: ';' expected.
labeledStatementDeclarationListInLoopNoCrash4.ts(14,12): error TS1005: ';' expected.
labeledStatementDeclarationListInLoopNoCrash4.ts(14,12): error TS1344: 'A label is not allowed here.
labeledStatementDeclarationListInLoopNoCrash4.ts(14,12): error TS1344: A label is not allowed here.
labeledStatementDeclarationListInLoopNoCrash4.ts(14,27): error TS1005: ',' expected.
labeledStatementDeclarationListInLoopNoCrash4.ts(20,1): error TS1005: '}' expected.
labeledStatementDeclarationListInLoopNoCrash4.ts(20,1): error TS1160: Unterminated template literal.
Expand Down Expand Up @@ -53,7 +53,7 @@ labeledStatementDeclarationListInLoopNoCrash4.ts(20,1): error TS1160: Unterminat
~~~~~~
!!! error TS1005: ';' expected.
~~~~~~
!!! error TS1344: 'A label is not allowed here.
!!! error TS1344: A label is not allowed here.
~~
].join(';')
~~~~~~~~~~~~~~~~~~~
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
labeledStatementExportDeclarationNoCrash1.ts(3,14): error TS1155: 'const' declarations must be initialized.
labeledStatementExportDeclarationNoCrash1.ts(4,1): error TS1344: 'A label is not allowed here.
labeledStatementExportDeclarationNoCrash1.ts(4,1): error TS1344: A label is not allowed here.
labeledStatementExportDeclarationNoCrash1.ts(5,1): error TS1184: Modifiers cannot appear here.
labeledStatementExportDeclarationNoCrash1.ts(5,14): error TS1155: 'const' declarations must be initialized.

Expand All @@ -12,7 +12,7 @@ labeledStatementExportDeclarationNoCrash1.ts(5,14): error TS1155: 'const' declar
!!! error TS1155: 'const' declarations must be initialized.
subTitle:
~~~~~~~~
!!! error TS1344: 'A label is not allowed here.
!!! error TS1344: A label is not allowed here.
export const title: string
~~~~~~
!!! error TS1184: Modifiers cannot appear here.
Expand Down
Loading
Loading