From 238e1c6f4bedfcd2dc0d64acdac58b33f665fef6 Mon Sep 17 00:00:00 2001 From: Vladimir Matveev Date: Tue, 13 Oct 2015 11:17:10 -0700 Subject: [PATCH] partially suppress reachability errors in tests --- .../reference/commentsAtEndOfFile1.errors.txt | 10 - .../reference/commentsAtEndOfFile1.js | 1 + .../reference/commentsAtEndOfFile1.symbols | 7 + .../reference/commentsAtEndOfFile1.types | 8 + .../reference/parser_breakTarget3.errors.txt | 11 - .../reference/parser_breakTarget3.js | 1 + .../reference/parser_breakTarget3.symbols | 8 + .../reference/parser_breakTarget3.types | 14 + .../reference/parser_breakTarget4.errors.txt | 11 - .../reference/parser_breakTarget4.js | 1 + .../reference/parser_breakTarget4.symbols | 8 + .../reference/parser_breakTarget4.types | 14 + .../parser_continueTarget3.errors.txt | 11 - .../reference/parser_continueTarget3.js | 1 + .../reference/parser_continueTarget3.symbols | 8 + .../reference/parser_continueTarget3.types | 14 + .../parser_continueTarget4.errors.txt | 11 - .../reference/parser_continueTarget4.js | 1 + .../reference/parser_continueTarget4.symbols | 8 + .../reference/parser_continueTarget4.types | 14 + .../parser_duplicateLabel3.errors.txt | 17 -- .../reference/parser_duplicateLabel3.js | 1 + .../reference/parser_duplicateLabel3.symbols | 12 + .../reference/parser_duplicateLabel3.types | 19 ++ .../parser_duplicateLabel4.errors.txt | 16 -- .../reference/parser_duplicateLabel4.js | 1 + .../reference/parser_duplicateLabel4.symbols | 10 + .../reference/parser_duplicateLabel4.types | 15 + .../reference/recursiveMods.errors.txt | 29 -- tests/baselines/reference/recursiveMods.js | 1 + .../baselines/reference/recursiveMods.symbols | 48 ++++ tests/baselines/reference/recursiveMods.types | 54 ++++ .../reference/returnStatement1.errors.txt | 12 - tests/baselines/reference/returnStatement1.js | 1 + .../reference/returnStatement1.symbols | 15 + .../reference/returnStatement1.types | 18 ++ .../sourceMapValidationLabeled.errors.txt | 8 - .../reference/sourceMapValidationLabeled.js | 1 + .../sourceMapValidationLabeled.js.map | 2 +- .../sourceMapValidationLabeled.sourcemap.txt | 19 +- .../sourceMapValidationLabeled.symbols | 6 + .../sourceMapValidationLabeled.types | 9 + .../switchBreakStatements.errors.txt | 67 ----- .../reference/switchBreakStatements.js | 1 + .../reference/switchBreakStatements.symbols | 59 ++++ .../reference/switchBreakStatements.types | 127 +++++++++ .../reference/systemModule8.errors.txt | 36 --- .../baselines/reference/systemModule8.symbols | 92 ++++++ tests/baselines/reference/systemModule8.types | 143 ++++++++++ .../throwInEnclosingStatements.errors.txt | 52 ---- .../reference/throwInEnclosingStatements.js | 1 + .../throwInEnclosingStatements.symbols | 94 ++++++ .../throwInEnclosingStatements.types | 110 ++++++++ .../reference/throwStatements.errors.txt | 91 ------ tests/baselines/reference/throwStatements.js | 1 + .../reference/throwStatements.symbols | 216 ++++++++++++++ .../baselines/reference/throwStatements.types | 267 ++++++++++++++++++ .../typeofOperatorWithBooleanType.errors.txt | 59 ---- .../typeofOperatorWithBooleanType.js | 1 + .../typeofOperatorWithBooleanType.symbols | 131 +++++++++ .../typeofOperatorWithBooleanType.types | 177 ++++++++++++ .../typeofOperatorWithEnumType.errors.txt | 33 --- .../reference/typeofOperatorWithEnumType.js | 1 + .../typeofOperatorWithEnumType.symbols | 70 +++++ .../typeofOperatorWithEnumType.types | 99 +++++++ tests/cases/compiler/commentsAtEndOfFile1.ts | 2 + tests/cases/compiler/recursiveMods.ts | 4 +- tests/cases/compiler/returnStatement1.ts | 2 + .../compiler/sourceMapValidationLabeled.ts | 2 + tests/cases/compiler/systemModule8.ts | 1 + .../typeofOperatorWithBooleanType.ts | 2 + .../typeofOperatorWithEnumType.ts | 2 + .../BreakStatements/parser_breakTarget3.ts | 2 + .../BreakStatements/parser_breakTarget4.ts | 2 + .../parser_continueTarget3.ts | 2 + .../parser_continueTarget4.ts | 2 + .../parser_duplicateLabel3.ts | 2 + .../parser_duplicateLabel4.ts | 3 + .../breakStatements/switchBreakStatements.ts | 3 + .../throwInEnclosingStatements.ts | 2 + .../throwStatements/throwStatements.ts | 2 + 81 files changed, 1954 insertions(+), 485 deletions(-) delete mode 100644 tests/baselines/reference/commentsAtEndOfFile1.errors.txt create mode 100644 tests/baselines/reference/commentsAtEndOfFile1.symbols create mode 100644 tests/baselines/reference/commentsAtEndOfFile1.types delete mode 100644 tests/baselines/reference/parser_breakTarget3.errors.txt create mode 100644 tests/baselines/reference/parser_breakTarget3.symbols create mode 100644 tests/baselines/reference/parser_breakTarget3.types delete mode 100644 tests/baselines/reference/parser_breakTarget4.errors.txt create mode 100644 tests/baselines/reference/parser_breakTarget4.symbols create mode 100644 tests/baselines/reference/parser_breakTarget4.types delete mode 100644 tests/baselines/reference/parser_continueTarget3.errors.txt create mode 100644 tests/baselines/reference/parser_continueTarget3.symbols create mode 100644 tests/baselines/reference/parser_continueTarget3.types delete mode 100644 tests/baselines/reference/parser_continueTarget4.errors.txt create mode 100644 tests/baselines/reference/parser_continueTarget4.symbols create mode 100644 tests/baselines/reference/parser_continueTarget4.types delete mode 100644 tests/baselines/reference/parser_duplicateLabel3.errors.txt create mode 100644 tests/baselines/reference/parser_duplicateLabel3.symbols create mode 100644 tests/baselines/reference/parser_duplicateLabel3.types delete mode 100644 tests/baselines/reference/parser_duplicateLabel4.errors.txt create mode 100644 tests/baselines/reference/parser_duplicateLabel4.symbols create mode 100644 tests/baselines/reference/parser_duplicateLabel4.types delete mode 100644 tests/baselines/reference/recursiveMods.errors.txt create mode 100644 tests/baselines/reference/recursiveMods.symbols create mode 100644 tests/baselines/reference/recursiveMods.types delete mode 100644 tests/baselines/reference/returnStatement1.errors.txt create mode 100644 tests/baselines/reference/returnStatement1.symbols create mode 100644 tests/baselines/reference/returnStatement1.types delete mode 100644 tests/baselines/reference/sourceMapValidationLabeled.errors.txt create mode 100644 tests/baselines/reference/sourceMapValidationLabeled.symbols create mode 100644 tests/baselines/reference/sourceMapValidationLabeled.types delete mode 100644 tests/baselines/reference/switchBreakStatements.errors.txt create mode 100644 tests/baselines/reference/switchBreakStatements.symbols create mode 100644 tests/baselines/reference/switchBreakStatements.types delete mode 100644 tests/baselines/reference/systemModule8.errors.txt create mode 100644 tests/baselines/reference/systemModule8.symbols create mode 100644 tests/baselines/reference/systemModule8.types delete mode 100644 tests/baselines/reference/throwInEnclosingStatements.errors.txt create mode 100644 tests/baselines/reference/throwInEnclosingStatements.symbols create mode 100644 tests/baselines/reference/throwInEnclosingStatements.types delete mode 100644 tests/baselines/reference/throwStatements.errors.txt create mode 100644 tests/baselines/reference/throwStatements.symbols create mode 100644 tests/baselines/reference/throwStatements.types delete mode 100644 tests/baselines/reference/typeofOperatorWithBooleanType.errors.txt create mode 100644 tests/baselines/reference/typeofOperatorWithBooleanType.symbols create mode 100644 tests/baselines/reference/typeofOperatorWithBooleanType.types delete mode 100644 tests/baselines/reference/typeofOperatorWithEnumType.errors.txt create mode 100644 tests/baselines/reference/typeofOperatorWithEnumType.symbols create mode 100644 tests/baselines/reference/typeofOperatorWithEnumType.types diff --git a/tests/baselines/reference/commentsAtEndOfFile1.errors.txt b/tests/baselines/reference/commentsAtEndOfFile1.errors.txt deleted file mode 100644 index dd689841659..00000000000 --- a/tests/baselines/reference/commentsAtEndOfFile1.errors.txt +++ /dev/null @@ -1,10 +0,0 @@ -tests/cases/compiler/commentsAtEndOfFile1.ts(1,1): error TS7028: Unused label. - - -==== tests/cases/compiler/commentsAtEndOfFile1.ts (1 errors) ==== - Input: - ~~~~~ -!!! error TS7028: Unused label. - ; - //Testing two - \ No newline at end of file diff --git a/tests/baselines/reference/commentsAtEndOfFile1.js b/tests/baselines/reference/commentsAtEndOfFile1.js index 2d4dae39e6b..d93dded59b0 100644 --- a/tests/baselines/reference/commentsAtEndOfFile1.js +++ b/tests/baselines/reference/commentsAtEndOfFile1.js @@ -1,4 +1,5 @@ //// [commentsAtEndOfFile1.ts] + Input: ; //Testing two diff --git a/tests/baselines/reference/commentsAtEndOfFile1.symbols b/tests/baselines/reference/commentsAtEndOfFile1.symbols new file mode 100644 index 00000000000..d35b4f251f6 --- /dev/null +++ b/tests/baselines/reference/commentsAtEndOfFile1.symbols @@ -0,0 +1,7 @@ +=== tests/cases/compiler/commentsAtEndOfFile1.ts === + +No type information for this code.Input: +No type information for this code.; +No type information for this code.//Testing two +No type information for this code. +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/commentsAtEndOfFile1.types b/tests/baselines/reference/commentsAtEndOfFile1.types new file mode 100644 index 00000000000..71eb367738b --- /dev/null +++ b/tests/baselines/reference/commentsAtEndOfFile1.types @@ -0,0 +1,8 @@ +=== tests/cases/compiler/commentsAtEndOfFile1.ts === + +Input: +>Input : any + +; +//Testing two + diff --git a/tests/baselines/reference/parser_breakTarget3.errors.txt b/tests/baselines/reference/parser_breakTarget3.errors.txt deleted file mode 100644 index ad3123eda79..00000000000 --- a/tests/baselines/reference/parser_breakTarget3.errors.txt +++ /dev/null @@ -1,11 +0,0 @@ -tests/cases/conformance/parser/ecmascript5/Statements/BreakStatements/parser_breakTarget3.ts(2,1): error TS7028: Unused label. - - -==== tests/cases/conformance/parser/ecmascript5/Statements/BreakStatements/parser_breakTarget3.ts (1 errors) ==== - target1: - target2: - ~~~~~~~ -!!! error TS7028: Unused label. - while (true) { - break target1; - } \ No newline at end of file diff --git a/tests/baselines/reference/parser_breakTarget3.js b/tests/baselines/reference/parser_breakTarget3.js index 0eceba87bf8..91ba9fb5993 100644 --- a/tests/baselines/reference/parser_breakTarget3.js +++ b/tests/baselines/reference/parser_breakTarget3.js @@ -1,4 +1,5 @@ //// [parser_breakTarget3.ts] + target1: target2: while (true) { diff --git a/tests/baselines/reference/parser_breakTarget3.symbols b/tests/baselines/reference/parser_breakTarget3.symbols new file mode 100644 index 00000000000..35184471d4d --- /dev/null +++ b/tests/baselines/reference/parser_breakTarget3.symbols @@ -0,0 +1,8 @@ +=== tests/cases/conformance/parser/ecmascript5/Statements/BreakStatements/parser_breakTarget3.ts === + +No type information for this code.target1: +No type information for this code.target2: +No type information for this code.while (true) { +No type information for this code. break target1; +No type information for this code.} +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/parser_breakTarget3.types b/tests/baselines/reference/parser_breakTarget3.types new file mode 100644 index 00000000000..b1ce9f8d94d --- /dev/null +++ b/tests/baselines/reference/parser_breakTarget3.types @@ -0,0 +1,14 @@ +=== tests/cases/conformance/parser/ecmascript5/Statements/BreakStatements/parser_breakTarget3.ts === + +target1: +>target1 : any + +target2: +>target2 : any + +while (true) { +>true : boolean + + break target1; +>target1 : any +} diff --git a/tests/baselines/reference/parser_breakTarget4.errors.txt b/tests/baselines/reference/parser_breakTarget4.errors.txt deleted file mode 100644 index 8c61b20b0ed..00000000000 --- a/tests/baselines/reference/parser_breakTarget4.errors.txt +++ /dev/null @@ -1,11 +0,0 @@ -tests/cases/conformance/parser/ecmascript5/Statements/BreakStatements/parser_breakTarget4.ts(1,1): error TS7028: Unused label. - - -==== tests/cases/conformance/parser/ecmascript5/Statements/BreakStatements/parser_breakTarget4.ts (1 errors) ==== - target1: - ~~~~~~~ -!!! error TS7028: Unused label. - target2: - while (true) { - break target2; - } \ No newline at end of file diff --git a/tests/baselines/reference/parser_breakTarget4.js b/tests/baselines/reference/parser_breakTarget4.js index c6cadb5efa1..4516cf3e8f9 100644 --- a/tests/baselines/reference/parser_breakTarget4.js +++ b/tests/baselines/reference/parser_breakTarget4.js @@ -1,4 +1,5 @@ //// [parser_breakTarget4.ts] + target1: target2: while (true) { diff --git a/tests/baselines/reference/parser_breakTarget4.symbols b/tests/baselines/reference/parser_breakTarget4.symbols new file mode 100644 index 00000000000..f4d4b2e4bff --- /dev/null +++ b/tests/baselines/reference/parser_breakTarget4.symbols @@ -0,0 +1,8 @@ +=== tests/cases/conformance/parser/ecmascript5/Statements/BreakStatements/parser_breakTarget4.ts === + +No type information for this code.target1: +No type information for this code.target2: +No type information for this code.while (true) { +No type information for this code. break target2; +No type information for this code.} +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/parser_breakTarget4.types b/tests/baselines/reference/parser_breakTarget4.types new file mode 100644 index 00000000000..04bb129c919 --- /dev/null +++ b/tests/baselines/reference/parser_breakTarget4.types @@ -0,0 +1,14 @@ +=== tests/cases/conformance/parser/ecmascript5/Statements/BreakStatements/parser_breakTarget4.ts === + +target1: +>target1 : any + +target2: +>target2 : any + +while (true) { +>true : boolean + + break target2; +>target2 : any +} diff --git a/tests/baselines/reference/parser_continueTarget3.errors.txt b/tests/baselines/reference/parser_continueTarget3.errors.txt deleted file mode 100644 index 4871cb275e7..00000000000 --- a/tests/baselines/reference/parser_continueTarget3.errors.txt +++ /dev/null @@ -1,11 +0,0 @@ -tests/cases/conformance/parser/ecmascript5/Statements/ContinueStatements/parser_continueTarget3.ts(2,1): error TS7028: Unused label. - - -==== tests/cases/conformance/parser/ecmascript5/Statements/ContinueStatements/parser_continueTarget3.ts (1 errors) ==== - target1: - target2: - ~~~~~~~ -!!! error TS7028: Unused label. - while (true) { - continue target1; - } \ No newline at end of file diff --git a/tests/baselines/reference/parser_continueTarget3.js b/tests/baselines/reference/parser_continueTarget3.js index 76a98a0e204..ea1559346de 100644 --- a/tests/baselines/reference/parser_continueTarget3.js +++ b/tests/baselines/reference/parser_continueTarget3.js @@ -1,4 +1,5 @@ //// [parser_continueTarget3.ts] + target1: target2: while (true) { diff --git a/tests/baselines/reference/parser_continueTarget3.symbols b/tests/baselines/reference/parser_continueTarget3.symbols new file mode 100644 index 00000000000..c522444ca1a --- /dev/null +++ b/tests/baselines/reference/parser_continueTarget3.symbols @@ -0,0 +1,8 @@ +=== tests/cases/conformance/parser/ecmascript5/Statements/ContinueStatements/parser_continueTarget3.ts === + +No type information for this code.target1: +No type information for this code.target2: +No type information for this code.while (true) { +No type information for this code. continue target1; +No type information for this code.} +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/parser_continueTarget3.types b/tests/baselines/reference/parser_continueTarget3.types new file mode 100644 index 00000000000..fd8aedc357f --- /dev/null +++ b/tests/baselines/reference/parser_continueTarget3.types @@ -0,0 +1,14 @@ +=== tests/cases/conformance/parser/ecmascript5/Statements/ContinueStatements/parser_continueTarget3.ts === + +target1: +>target1 : any + +target2: +>target2 : any + +while (true) { +>true : boolean + + continue target1; +>target1 : any +} diff --git a/tests/baselines/reference/parser_continueTarget4.errors.txt b/tests/baselines/reference/parser_continueTarget4.errors.txt deleted file mode 100644 index 6089ea60cf7..00000000000 --- a/tests/baselines/reference/parser_continueTarget4.errors.txt +++ /dev/null @@ -1,11 +0,0 @@ -tests/cases/conformance/parser/ecmascript5/Statements/ContinueStatements/parser_continueTarget4.ts(1,1): error TS7028: Unused label. - - -==== tests/cases/conformance/parser/ecmascript5/Statements/ContinueStatements/parser_continueTarget4.ts (1 errors) ==== - target1: - ~~~~~~~ -!!! error TS7028: Unused label. - target2: - while (true) { - continue target2; - } \ No newline at end of file diff --git a/tests/baselines/reference/parser_continueTarget4.js b/tests/baselines/reference/parser_continueTarget4.js index 795cab2e2ad..9ccaaac27e7 100644 --- a/tests/baselines/reference/parser_continueTarget4.js +++ b/tests/baselines/reference/parser_continueTarget4.js @@ -1,4 +1,5 @@ //// [parser_continueTarget4.ts] + target1: target2: while (true) { diff --git a/tests/baselines/reference/parser_continueTarget4.symbols b/tests/baselines/reference/parser_continueTarget4.symbols new file mode 100644 index 00000000000..b7e770f9bf9 --- /dev/null +++ b/tests/baselines/reference/parser_continueTarget4.symbols @@ -0,0 +1,8 @@ +=== tests/cases/conformance/parser/ecmascript5/Statements/ContinueStatements/parser_continueTarget4.ts === + +No type information for this code.target1: +No type information for this code.target2: +No type information for this code.while (true) { +No type information for this code. continue target2; +No type information for this code.} +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/parser_continueTarget4.types b/tests/baselines/reference/parser_continueTarget4.types new file mode 100644 index 00000000000..be1e5458f4b --- /dev/null +++ b/tests/baselines/reference/parser_continueTarget4.types @@ -0,0 +1,14 @@ +=== tests/cases/conformance/parser/ecmascript5/Statements/ContinueStatements/parser_continueTarget4.ts === + +target1: +>target1 : any + +target2: +>target2 : any + +while (true) { +>true : boolean + + continue target2; +>target2 : any +} diff --git a/tests/baselines/reference/parser_duplicateLabel3.errors.txt b/tests/baselines/reference/parser_duplicateLabel3.errors.txt deleted file mode 100644 index a933588f538..00000000000 --- a/tests/baselines/reference/parser_duplicateLabel3.errors.txt +++ /dev/null @@ -1,17 +0,0 @@ -tests/cases/conformance/parser/ecmascript5/Statements/LabeledStatements/parser_duplicateLabel3.ts(1,1): error TS7028: Unused label. -tests/cases/conformance/parser/ecmascript5/Statements/LabeledStatements/parser_duplicateLabel3.ts(4,5): error TS7028: Unused label. - - -==== tests/cases/conformance/parser/ecmascript5/Statements/LabeledStatements/parser_duplicateLabel3.ts (2 errors) ==== - target: - ~~~~~~ -!!! error TS7028: Unused label. - while (true) { - function f() { - target: - ~~~~~~ -!!! error TS7028: Unused label. - while (true) { - } - } - } \ No newline at end of file diff --git a/tests/baselines/reference/parser_duplicateLabel3.js b/tests/baselines/reference/parser_duplicateLabel3.js index 9bd6c56356a..c2ea2769f18 100644 --- a/tests/baselines/reference/parser_duplicateLabel3.js +++ b/tests/baselines/reference/parser_duplicateLabel3.js @@ -1,4 +1,5 @@ //// [parser_duplicateLabel3.ts] + target: while (true) { function f() { diff --git a/tests/baselines/reference/parser_duplicateLabel3.symbols b/tests/baselines/reference/parser_duplicateLabel3.symbols new file mode 100644 index 00000000000..7e238eb2916 --- /dev/null +++ b/tests/baselines/reference/parser_duplicateLabel3.symbols @@ -0,0 +1,12 @@ +=== tests/cases/conformance/parser/ecmascript5/Statements/LabeledStatements/parser_duplicateLabel3.ts === + +target: +while (true) { + function f() { +>f : Symbol(f, Decl(parser_duplicateLabel3.ts, 2, 14)) + + target: + while (true) { + } + } +} diff --git a/tests/baselines/reference/parser_duplicateLabel3.types b/tests/baselines/reference/parser_duplicateLabel3.types new file mode 100644 index 00000000000..88ea435bf3e --- /dev/null +++ b/tests/baselines/reference/parser_duplicateLabel3.types @@ -0,0 +1,19 @@ +=== tests/cases/conformance/parser/ecmascript5/Statements/LabeledStatements/parser_duplicateLabel3.ts === + +target: +>target : any + +while (true) { +>true : boolean + + function f() { +>f : () => void + + target: +>target : any + + while (true) { +>true : boolean + } + } +} diff --git a/tests/baselines/reference/parser_duplicateLabel4.errors.txt b/tests/baselines/reference/parser_duplicateLabel4.errors.txt deleted file mode 100644 index 4a0108ebe06..00000000000 --- a/tests/baselines/reference/parser_duplicateLabel4.errors.txt +++ /dev/null @@ -1,16 +0,0 @@ -tests/cases/conformance/parser/ecmascript5/Statements/LabeledStatements/parser_duplicateLabel4.ts(1,1): error TS7028: Unused label. -tests/cases/conformance/parser/ecmascript5/Statements/LabeledStatements/parser_duplicateLabel4.ts(5,1): error TS7027: Unreachable code detected. - - -==== tests/cases/conformance/parser/ecmascript5/Statements/LabeledStatements/parser_duplicateLabel4.ts (2 errors) ==== - target: - ~~~~~~ -!!! error TS7028: Unused label. - while (true) { - } - - target: - ~~~~~~ -!!! error TS7027: Unreachable code detected. - while (true) { - } \ No newline at end of file diff --git a/tests/baselines/reference/parser_duplicateLabel4.js b/tests/baselines/reference/parser_duplicateLabel4.js index 569a9bcd102..a9491314426 100644 --- a/tests/baselines/reference/parser_duplicateLabel4.js +++ b/tests/baselines/reference/parser_duplicateLabel4.js @@ -1,4 +1,5 @@ //// [parser_duplicateLabel4.ts] + target: while (true) { } diff --git a/tests/baselines/reference/parser_duplicateLabel4.symbols b/tests/baselines/reference/parser_duplicateLabel4.symbols new file mode 100644 index 00000000000..e7123de1600 --- /dev/null +++ b/tests/baselines/reference/parser_duplicateLabel4.symbols @@ -0,0 +1,10 @@ +=== tests/cases/conformance/parser/ecmascript5/Statements/LabeledStatements/parser_duplicateLabel4.ts === + +No type information for this code.target: +No type information for this code.while (true) { +No type information for this code.} +No type information for this code. +No type information for this code.target: +No type information for this code.while (true) { +No type information for this code.} +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/parser_duplicateLabel4.types b/tests/baselines/reference/parser_duplicateLabel4.types new file mode 100644 index 00000000000..b70dd12c695 --- /dev/null +++ b/tests/baselines/reference/parser_duplicateLabel4.types @@ -0,0 +1,15 @@ +=== tests/cases/conformance/parser/ecmascript5/Statements/LabeledStatements/parser_duplicateLabel4.ts === + +target: +>target : any + +while (true) { +>true : boolean +} + +target: +>target : any + +while (true) { +>true : boolean +} diff --git a/tests/baselines/reference/recursiveMods.errors.txt b/tests/baselines/reference/recursiveMods.errors.txt deleted file mode 100644 index 6adba78d004..00000000000 --- a/tests/baselines/reference/recursiveMods.errors.txt +++ /dev/null @@ -1,29 +0,0 @@ -tests/cases/compiler/recursiveMods.ts(9,3): error TS7027: Unreachable code detected. - - -==== tests/cases/compiler/recursiveMods.ts (1 errors) ==== - export module Foo { - export class C {} - } - - export module Foo { - - function Bar() : C { - if (true) { return Bar();} - return new C(); - ~~~~~~ -!!! error TS7027: Unreachable code detected. - } - - function Baz() : C { - var c = Baz(); - return Bar(); - } - - function Gar() { - var c : C = Baz(); - return; - } - - } - \ No newline at end of file diff --git a/tests/baselines/reference/recursiveMods.js b/tests/baselines/reference/recursiveMods.js index 36d2712e040..f913ddec012 100644 --- a/tests/baselines/reference/recursiveMods.js +++ b/tests/baselines/reference/recursiveMods.js @@ -1,4 +1,5 @@ //// [recursiveMods.ts] + export module Foo { export class C {} } diff --git a/tests/baselines/reference/recursiveMods.symbols b/tests/baselines/reference/recursiveMods.symbols new file mode 100644 index 00000000000..5f6d6f87721 --- /dev/null +++ b/tests/baselines/reference/recursiveMods.symbols @@ -0,0 +1,48 @@ +=== tests/cases/compiler/recursiveMods.ts === + +export module Foo { +>Foo : Symbol(Foo, Decl(recursiveMods.ts, 0, 0), Decl(recursiveMods.ts, 3, 1)) + + export class C {} +>C : Symbol(C, Decl(recursiveMods.ts, 1, 19)) +} + +export module Foo { +>Foo : Symbol(Foo, Decl(recursiveMods.ts, 0, 0), Decl(recursiveMods.ts, 3, 1)) + + function Bar() : C { +>Bar : Symbol(Bar, Decl(recursiveMods.ts, 5, 19)) +>C : Symbol(C, Decl(recursiveMods.ts, 1, 19)) + + if (true) { return Bar();} +>Bar : Symbol(Bar, Decl(recursiveMods.ts, 5, 19)) + + return new C(); +>C : Symbol(C, Decl(recursiveMods.ts, 1, 19)) + } + + function Baz() : C { +>Baz : Symbol(Baz, Decl(recursiveMods.ts, 10, 2)) +>C : Symbol(C, Decl(recursiveMods.ts, 1, 19)) + + var c = Baz(); +>c : Symbol(c, Decl(recursiveMods.ts, 13, 5)) +>Baz : Symbol(Baz, Decl(recursiveMods.ts, 10, 2)) + + return Bar(); +>Bar : Symbol(Bar, Decl(recursiveMods.ts, 5, 19)) + } + + function Gar() { +>Gar : Symbol(Gar, Decl(recursiveMods.ts, 15, 2)) + + var c : C = Baz(); +>c : Symbol(c, Decl(recursiveMods.ts, 18, 5)) +>C : Symbol(C, Decl(recursiveMods.ts, 1, 19)) +>Baz : Symbol(Baz, Decl(recursiveMods.ts, 10, 2)) + + return; + } + +} + diff --git a/tests/baselines/reference/recursiveMods.types b/tests/baselines/reference/recursiveMods.types new file mode 100644 index 00000000000..d4db816daf7 --- /dev/null +++ b/tests/baselines/reference/recursiveMods.types @@ -0,0 +1,54 @@ +=== tests/cases/compiler/recursiveMods.ts === + +export module Foo { +>Foo : typeof Foo + + export class C {} +>C : C +} + +export module Foo { +>Foo : typeof Foo + + function Bar() : C { +>Bar : () => C +>C : C + + if (true) { return Bar();} +>true : boolean +>Bar() : C +>Bar : () => C + + return new C(); +>new C() : C +>C : typeof C + } + + function Baz() : C { +>Baz : () => C +>C : C + + var c = Baz(); +>c : C +>Baz() : C +>Baz : () => C + + return Bar(); +>Bar() : C +>Bar : () => C + } + + function Gar() { +>Gar : () => void + + var c : C = Baz(); +>c : C +>C : C +>Baz() : C +>Baz : () => C + + return; + } + +} + diff --git a/tests/baselines/reference/returnStatement1.errors.txt b/tests/baselines/reference/returnStatement1.errors.txt deleted file mode 100644 index af17564a874..00000000000 --- a/tests/baselines/reference/returnStatement1.errors.txt +++ /dev/null @@ -1,12 +0,0 @@ -tests/cases/compiler/returnStatement1.ts(5,5): error TS7027: Unreachable code detected. - - -==== tests/cases/compiler/returnStatement1.ts (1 errors) ==== - function f() { - return function (s) { - var x = s; - }; - ("harmless extra line"); - ~ -!!! error TS7027: Unreachable code detected. - } \ No newline at end of file diff --git a/tests/baselines/reference/returnStatement1.js b/tests/baselines/reference/returnStatement1.js index c4ccc3cadde..3f5c5561b2a 100644 --- a/tests/baselines/reference/returnStatement1.js +++ b/tests/baselines/reference/returnStatement1.js @@ -1,4 +1,5 @@ //// [returnStatement1.ts] + function f() { return function (s) { var x = s; diff --git a/tests/baselines/reference/returnStatement1.symbols b/tests/baselines/reference/returnStatement1.symbols new file mode 100644 index 00000000000..6727cba0df5 --- /dev/null +++ b/tests/baselines/reference/returnStatement1.symbols @@ -0,0 +1,15 @@ +=== tests/cases/compiler/returnStatement1.ts === + +function f() { +>f : Symbol(f, Decl(returnStatement1.ts, 0, 0)) + + return function (s) { +>s : Symbol(s, Decl(returnStatement1.ts, 2, 21)) + + var x = s; +>x : Symbol(x, Decl(returnStatement1.ts, 3, 11)) +>s : Symbol(s, Decl(returnStatement1.ts, 2, 21)) + + }; + ("harmless extra line"); +} diff --git a/tests/baselines/reference/returnStatement1.types b/tests/baselines/reference/returnStatement1.types new file mode 100644 index 00000000000..b7e166ffa75 --- /dev/null +++ b/tests/baselines/reference/returnStatement1.types @@ -0,0 +1,18 @@ +=== tests/cases/compiler/returnStatement1.ts === + +function f() { +>f : () => (s: any) => void + + return function (s) { +>function (s) { var x = s; } : (s: any) => void +>s : any + + var x = s; +>x : any +>s : any + + }; + ("harmless extra line"); +>("harmless extra line") : string +>"harmless extra line" : string +} diff --git a/tests/baselines/reference/sourceMapValidationLabeled.errors.txt b/tests/baselines/reference/sourceMapValidationLabeled.errors.txt deleted file mode 100644 index e9cf1fb3db8..00000000000 --- a/tests/baselines/reference/sourceMapValidationLabeled.errors.txt +++ /dev/null @@ -1,8 +0,0 @@ -tests/cases/compiler/sourceMapValidationLabeled.ts(1,1): error TS7028: Unused label. - - -==== tests/cases/compiler/sourceMapValidationLabeled.ts (1 errors) ==== - x: - ~ -!!! error TS7028: Unused label. - var b = 10; \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationLabeled.js b/tests/baselines/reference/sourceMapValidationLabeled.js index 7aabc47ea4e..50669b870ab 100644 --- a/tests/baselines/reference/sourceMapValidationLabeled.js +++ b/tests/baselines/reference/sourceMapValidationLabeled.js @@ -1,4 +1,5 @@ //// [sourceMapValidationLabeled.ts] + x: var b = 10; diff --git a/tests/baselines/reference/sourceMapValidationLabeled.js.map b/tests/baselines/reference/sourceMapValidationLabeled.js.map index d1219f9896f..206ac95b951 100644 --- a/tests/baselines/reference/sourceMapValidationLabeled.js.map +++ b/tests/baselines/reference/sourceMapValidationLabeled.js.map @@ -1,2 +1,2 @@ //// [sourceMapValidationLabeled.js.map] -{"version":3,"file":"sourceMapValidationLabeled.js","sourceRoot":"","sources":["sourceMapValidationLabeled.ts"],"names":[],"mappings":"AAAA,CAAC,EACD,IAAI,CAAC,GAAG,EAAE,CAAC"} \ No newline at end of file +{"version":3,"file":"sourceMapValidationLabeled.js","sourceRoot":"","sources":["sourceMapValidationLabeled.ts"],"names":[],"mappings":"AACA,CAAC,EACD,IAAI,CAAC,GAAG,EAAE,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationLabeled.sourcemap.txt b/tests/baselines/reference/sourceMapValidationLabeled.sourcemap.txt index 007208c78f9..7cf1bf896ca 100644 --- a/tests/baselines/reference/sourceMapValidationLabeled.sourcemap.txt +++ b/tests/baselines/reference/sourceMapValidationLabeled.sourcemap.txt @@ -18,7 +18,8 @@ sourceFile:sourceMapValidationLabeled.ts 7 > ^^ 8 > ^ 9 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > +1 > + > 2 >x 3 > : > @@ -27,13 +28,13 @@ sourceFile:sourceMapValidationLabeled.ts 6 > = 7 > 10 8 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 2) Source(1, 2) + SourceIndex(0) -3 >Emitted(1, 4) Source(2, 1) + SourceIndex(0) -4 >Emitted(1, 8) Source(2, 5) + SourceIndex(0) -5 >Emitted(1, 9) Source(2, 6) + SourceIndex(0) -6 >Emitted(1, 12) Source(2, 9) + SourceIndex(0) -7 >Emitted(1, 14) Source(2, 11) + SourceIndex(0) -8 >Emitted(1, 15) Source(2, 12) + SourceIndex(0) +1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(1, 2) Source(2, 2) + SourceIndex(0) +3 >Emitted(1, 4) Source(3, 1) + SourceIndex(0) +4 >Emitted(1, 8) Source(3, 5) + SourceIndex(0) +5 >Emitted(1, 9) Source(3, 6) + SourceIndex(0) +6 >Emitted(1, 12) Source(3, 9) + SourceIndex(0) +7 >Emitted(1, 14) Source(3, 11) + SourceIndex(0) +8 >Emitted(1, 15) Source(3, 12) + SourceIndex(0) --- >>>//# sourceMappingURL=sourceMapValidationLabeled.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationLabeled.symbols b/tests/baselines/reference/sourceMapValidationLabeled.symbols new file mode 100644 index 00000000000..bf9abc593b3 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationLabeled.symbols @@ -0,0 +1,6 @@ +=== tests/cases/compiler/sourceMapValidationLabeled.ts === + +x: +var b = 10; +>b : Symbol(b, Decl(sourceMapValidationLabeled.ts, 2, 3)) + diff --git a/tests/baselines/reference/sourceMapValidationLabeled.types b/tests/baselines/reference/sourceMapValidationLabeled.types new file mode 100644 index 00000000000..7af624ac93b --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationLabeled.types @@ -0,0 +1,9 @@ +=== tests/cases/compiler/sourceMapValidationLabeled.ts === + +x: +>x : any + +var b = 10; +>b : number +>10 : number + diff --git a/tests/baselines/reference/switchBreakStatements.errors.txt b/tests/baselines/reference/switchBreakStatements.errors.txt deleted file mode 100644 index 77577e485da..00000000000 --- a/tests/baselines/reference/switchBreakStatements.errors.txt +++ /dev/null @@ -1,67 +0,0 @@ -tests/cases/conformance/statements/breakStatements/switchBreakStatements.ts(12,1): error TS7028: Unused label. -tests/cases/conformance/statements/breakStatements/switchBreakStatements.ts(22,9): error TS7028: Unused label. -tests/cases/conformance/statements/breakStatements/switchBreakStatements.ts(46,25): error TS7027: Unreachable code detected. - - -==== tests/cases/conformance/statements/breakStatements/switchBreakStatements.ts (3 errors) ==== - switch ('') { - case 'a': - break; - } - - ONE: - switch ('') { - case 'a': - break ONE; - } - - TWO: - ~~~ -!!! error TS7028: Unused label. - THREE: - switch ('') { - case 'a': - break THREE; - } - - FOUR: - switch ('') { - case 'a': - FIVE: - ~~~~ -!!! error TS7028: Unused label. - switch ('') { - case 'a': - break FOUR; - } - } - - switch ('') { - case 'a': - SIX: - switch ('') { - case 'a': - break SIX; - } - } - - SEVEN: - switch ('') { - case 'a': - switch ('') { - case 'a': - switch ('') { - case 'a': - break SEVEN; - EIGHT: - ~~~~~ -!!! error TS7027: Unreachable code detected. - switch ('') { - case 'a': - var fn = function () { } - break EIGHT; - } - } - } - } - \ No newline at end of file diff --git a/tests/baselines/reference/switchBreakStatements.js b/tests/baselines/reference/switchBreakStatements.js index 534f025e2f5..d7fa279248c 100644 --- a/tests/baselines/reference/switchBreakStatements.js +++ b/tests/baselines/reference/switchBreakStatements.js @@ -1,4 +1,5 @@ //// [switchBreakStatements.ts] + switch ('') { case 'a': break; diff --git a/tests/baselines/reference/switchBreakStatements.symbols b/tests/baselines/reference/switchBreakStatements.symbols new file mode 100644 index 00000000000..dde7ca028cc --- /dev/null +++ b/tests/baselines/reference/switchBreakStatements.symbols @@ -0,0 +1,59 @@ +=== tests/cases/conformance/statements/breakStatements/switchBreakStatements.ts === + +switch ('') { + case 'a': + break; +} + +ONE: +switch ('') { + case 'a': + break ONE; +} + +TWO: +THREE: +switch ('') { + case 'a': + break THREE; +} + +FOUR: +switch ('') { + case 'a': + FIVE: + switch ('') { + case 'a': + break FOUR; + } +} + +switch ('') { + case 'a': + SIX: + switch ('') { + case 'a': + break SIX; + } +} + +SEVEN: +switch ('') { + case 'a': + switch ('') { + case 'a': + switch ('') { + case 'a': + break SEVEN; + EIGHT: + switch ('') { + case 'a': + var fn = function () { } +>fn : Symbol(fn, Decl(switchBreakStatements.ts, 49, 35)) + + break EIGHT; + } + } + } +} + diff --git a/tests/baselines/reference/switchBreakStatements.types b/tests/baselines/reference/switchBreakStatements.types new file mode 100644 index 00000000000..0364d878d5a --- /dev/null +++ b/tests/baselines/reference/switchBreakStatements.types @@ -0,0 +1,127 @@ +=== tests/cases/conformance/statements/breakStatements/switchBreakStatements.ts === + +switch ('') { +>'' : string + + case 'a': +>'a' : string + + break; +} + +ONE: +>ONE : any + +switch ('') { +>'' : string + + case 'a': +>'a' : string + + break ONE; +>ONE : any +} + +TWO: +>TWO : any + +THREE: +>THREE : any + +switch ('') { +>'' : string + + case 'a': +>'a' : string + + break THREE; +>THREE : any +} + +FOUR: +>FOUR : any + +switch ('') { +>'' : string + + case 'a': +>'a' : string + + FIVE: +>FIVE : any + + switch ('') { +>'' : string + + case 'a': +>'a' : string + + break FOUR; +>FOUR : any + } +} + +switch ('') { +>'' : string + + case 'a': +>'a' : string + + SIX: +>SIX : any + + switch ('') { +>'' : string + + case 'a': +>'a' : string + + break SIX; +>SIX : any + } +} + +SEVEN: +>SEVEN : any + +switch ('') { +>'' : string + + case 'a': +>'a' : string + + switch ('') { +>'' : string + + case 'a': +>'a' : string + + switch ('') { +>'' : string + + case 'a': +>'a' : string + + break SEVEN; +>SEVEN : any + + EIGHT: +>EIGHT : any + + switch ('') { +>'' : string + + case 'a': +>'a' : string + + var fn = function () { } +>fn : () => void +>function () { } : () => void + + break EIGHT; +>EIGHT : any + } + } + } +} + diff --git a/tests/baselines/reference/systemModule8.errors.txt b/tests/baselines/reference/systemModule8.errors.txt deleted file mode 100644 index 17a37e57d24..00000000000 --- a/tests/baselines/reference/systemModule8.errors.txt +++ /dev/null @@ -1,36 +0,0 @@ -tests/cases/compiler/systemModule8.ts(19,1): error TS7027: Unreachable code detected. - - -==== tests/cases/compiler/systemModule8.ts (1 errors) ==== - - export var x; - x = 1; - x++; - x--; - ++x; - --x; - x += 1; - x -= 1; - x *= 1; - x /= 1; - x |= 1; - x &= 1; - x + 1; - x - 1; - x & 1; - x | 1; - for (x = 5;;x++) {} - for (x = 8;;x--) {} - ~~~ -!!! error TS7027: Unreachable code detected. - for (x = 15;;++x) {} - for (x = 18;;--x) {} - - for (let x = 50;;) {} - function foo() { - x = 100; - } - - export let [y] = [1]; - export const {a: z0, b: {c: z1}} = {a: true, b: {c: "123"}}; - for ([x] of [[1]]) {} \ No newline at end of file diff --git a/tests/baselines/reference/systemModule8.symbols b/tests/baselines/reference/systemModule8.symbols new file mode 100644 index 00000000000..719d48e4592 --- /dev/null +++ b/tests/baselines/reference/systemModule8.symbols @@ -0,0 +1,92 @@ +=== tests/cases/compiler/systemModule8.ts === + +export var x; +>x : Symbol(x, Decl(systemModule8.ts, 1, 10)) + +x = 1; +>x : Symbol(x, Decl(systemModule8.ts, 1, 10)) + +x++; +>x : Symbol(x, Decl(systemModule8.ts, 1, 10)) + +x--; +>x : Symbol(x, Decl(systemModule8.ts, 1, 10)) + +++x; +>x : Symbol(x, Decl(systemModule8.ts, 1, 10)) + +--x; +>x : Symbol(x, Decl(systemModule8.ts, 1, 10)) + +x += 1; +>x : Symbol(x, Decl(systemModule8.ts, 1, 10)) + +x -= 1; +>x : Symbol(x, Decl(systemModule8.ts, 1, 10)) + +x *= 1; +>x : Symbol(x, Decl(systemModule8.ts, 1, 10)) + +x /= 1; +>x : Symbol(x, Decl(systemModule8.ts, 1, 10)) + +x |= 1; +>x : Symbol(x, Decl(systemModule8.ts, 1, 10)) + +x &= 1; +>x : Symbol(x, Decl(systemModule8.ts, 1, 10)) + +x + 1; +>x : Symbol(x, Decl(systemModule8.ts, 1, 10)) + +x - 1; +>x : Symbol(x, Decl(systemModule8.ts, 1, 10)) + +x & 1; +>x : Symbol(x, Decl(systemModule8.ts, 1, 10)) + +x | 1; +>x : Symbol(x, Decl(systemModule8.ts, 1, 10)) + +for (x = 5;;x++) {} +>x : Symbol(x, Decl(systemModule8.ts, 1, 10)) +>x : Symbol(x, Decl(systemModule8.ts, 1, 10)) + +for (x = 8;;x--) {} +>x : Symbol(x, Decl(systemModule8.ts, 1, 10)) +>x : Symbol(x, Decl(systemModule8.ts, 1, 10)) + +for (x = 15;;++x) {} +>x : Symbol(x, Decl(systemModule8.ts, 1, 10)) +>x : Symbol(x, Decl(systemModule8.ts, 1, 10)) + +for (x = 18;;--x) {} +>x : Symbol(x, Decl(systemModule8.ts, 1, 10)) +>x : Symbol(x, Decl(systemModule8.ts, 1, 10)) + +for (let x = 50;;) {} +>x : Symbol(x, Decl(systemModule8.ts, 22, 8)) + +function foo() { +>foo : Symbol(foo, Decl(systemModule8.ts, 22, 21)) + + x = 100; +>x : Symbol(x, Decl(systemModule8.ts, 1, 10)) +} + +export let [y] = [1]; +>y : Symbol(y, Decl(systemModule8.ts, 27, 12)) + +export const {a: z0, b: {c: z1}} = {a: true, b: {c: "123"}}; +>a : Symbol(a, Decl(systemModule8.ts, 28, 36)) +>z0 : Symbol(z0, Decl(systemModule8.ts, 28, 14)) +>b : Symbol(b, Decl(systemModule8.ts, 28, 44)) +>c : Symbol(c, Decl(systemModule8.ts, 28, 49)) +>z1 : Symbol(z1, Decl(systemModule8.ts, 28, 25)) +>a : Symbol(a, Decl(systemModule8.ts, 28, 36)) +>b : Symbol(b, Decl(systemModule8.ts, 28, 44)) +>c : Symbol(c, Decl(systemModule8.ts, 28, 49)) + +for ([x] of [[1]]) {} +>x : Symbol(x, Decl(systemModule8.ts, 1, 10)) + diff --git a/tests/baselines/reference/systemModule8.types b/tests/baselines/reference/systemModule8.types new file mode 100644 index 00000000000..2c3dd1e48bb --- /dev/null +++ b/tests/baselines/reference/systemModule8.types @@ -0,0 +1,143 @@ +=== tests/cases/compiler/systemModule8.ts === + +export var x; +>x : any + +x = 1; +>x = 1 : number +>x : any +>1 : number + +x++; +>x++ : number +>x : any + +x--; +>x-- : number +>x : any + +++x; +>++x : number +>x : any + +--x; +>--x : number +>x : any + +x += 1; +>x += 1 : any +>x : any +>1 : number + +x -= 1; +>x -= 1 : number +>x : any +>1 : number + +x *= 1; +>x *= 1 : number +>x : any +>1 : number + +x /= 1; +>x /= 1 : number +>x : any +>1 : number + +x |= 1; +>x |= 1 : number +>x : any +>1 : number + +x &= 1; +>x &= 1 : number +>x : any +>1 : number + +x + 1; +>x + 1 : any +>x : any +>1 : number + +x - 1; +>x - 1 : number +>x : any +>1 : number + +x & 1; +>x & 1 : number +>x : any +>1 : number + +x | 1; +>x | 1 : number +>x : any +>1 : number + +for (x = 5;;x++) {} +>x = 5 : number +>x : any +>5 : number +>x++ : number +>x : any + +for (x = 8;;x--) {} +>x = 8 : number +>x : any +>8 : number +>x-- : number +>x : any + +for (x = 15;;++x) {} +>x = 15 : number +>x : any +>15 : number +>++x : number +>x : any + +for (x = 18;;--x) {} +>x = 18 : number +>x : any +>18 : number +>--x : number +>x : any + +for (let x = 50;;) {} +>x : number +>50 : number + +function foo() { +>foo : () => void + + x = 100; +>x = 100 : number +>x : any +>100 : number +} + +export let [y] = [1]; +>y : number +>[1] : [number] +>1 : number + +export const {a: z0, b: {c: z1}} = {a: true, b: {c: "123"}}; +>a : any +>z0 : boolean +>b : any +>c : any +>z1 : string +>{a: true, b: {c: "123"}} : { a: boolean; b: { c: string; }; } +>a : boolean +>true : boolean +>b : { c: string; } +>{c: "123"} : { c: string; } +>c : string +>"123" : string + +for ([x] of [[1]]) {} +>[x] : any[] +>x : any +>[[1]] : number[][] +>[1] : number[] +>1 : number + diff --git a/tests/baselines/reference/throwInEnclosingStatements.errors.txt b/tests/baselines/reference/throwInEnclosingStatements.errors.txt deleted file mode 100644 index 1d225a45fe8..00000000000 --- a/tests/baselines/reference/throwInEnclosingStatements.errors.txt +++ /dev/null @@ -1,52 +0,0 @@ -tests/cases/conformance/statements/throwStatements/throwInEnclosingStatements.ts(15,1): error TS7027: Unreachable code detected. - - -==== tests/cases/conformance/statements/throwStatements/throwInEnclosingStatements.ts (1 errors) ==== - function fn(x) { - throw x; - } - - (x: T) => { throw x; } - - var y: string; - switch (y) { - case 'a': - throw y; - default: - throw y; - } - - var z = 0; - ~~~ -!!! error TS7027: Unreachable code detected. - while (z < 10) { - throw z; - } - - for (var i = 0; ;) { throw i; } - - for (var idx in {}) { throw idx; } - - do { throw null; }while(true) - - var j = 0; - while (j < 0) { throw j; } - - class C { - private value: T; - biz() { - throw this.value; - } - - constructor() { - throw this; - } - } - - var aa = { - id:12, - biz() { - throw this; - } - } - \ No newline at end of file diff --git a/tests/baselines/reference/throwInEnclosingStatements.js b/tests/baselines/reference/throwInEnclosingStatements.js index 0b072434f33..4d9200776e7 100644 --- a/tests/baselines/reference/throwInEnclosingStatements.js +++ b/tests/baselines/reference/throwInEnclosingStatements.js @@ -1,4 +1,5 @@ //// [throwInEnclosingStatements.ts] + function fn(x) { throw x; } diff --git a/tests/baselines/reference/throwInEnclosingStatements.symbols b/tests/baselines/reference/throwInEnclosingStatements.symbols new file mode 100644 index 00000000000..42053c60efa --- /dev/null +++ b/tests/baselines/reference/throwInEnclosingStatements.symbols @@ -0,0 +1,94 @@ +=== tests/cases/conformance/statements/throwStatements/throwInEnclosingStatements.ts === + +function fn(x) { +>fn : Symbol(fn, Decl(throwInEnclosingStatements.ts, 0, 0)) +>x : Symbol(x, Decl(throwInEnclosingStatements.ts, 1, 12)) + + throw x; +>x : Symbol(x, Decl(throwInEnclosingStatements.ts, 1, 12)) +} + +(x: T) => { throw x; } +>T : Symbol(T, Decl(throwInEnclosingStatements.ts, 5, 1)) +>x : Symbol(x, Decl(throwInEnclosingStatements.ts, 5, 4)) +>T : Symbol(T, Decl(throwInEnclosingStatements.ts, 5, 1)) +>x : Symbol(x, Decl(throwInEnclosingStatements.ts, 5, 4)) + +var y: string; +>y : Symbol(y, Decl(throwInEnclosingStatements.ts, 7, 3)) + +switch (y) { +>y : Symbol(y, Decl(throwInEnclosingStatements.ts, 7, 3)) + + case 'a': + throw y; +>y : Symbol(y, Decl(throwInEnclosingStatements.ts, 7, 3)) + + default: + throw y; +>y : Symbol(y, Decl(throwInEnclosingStatements.ts, 7, 3)) +} + +var z = 0; +>z : Symbol(z, Decl(throwInEnclosingStatements.ts, 15, 3)) + +while (z < 10) { +>z : Symbol(z, Decl(throwInEnclosingStatements.ts, 15, 3)) + + throw z; +>z : Symbol(z, Decl(throwInEnclosingStatements.ts, 15, 3)) +} + +for (var i = 0; ;) { throw i; } +>i : Symbol(i, Decl(throwInEnclosingStatements.ts, 20, 8)) +>i : Symbol(i, Decl(throwInEnclosingStatements.ts, 20, 8)) + +for (var idx in {}) { throw idx; } +>idx : Symbol(idx, Decl(throwInEnclosingStatements.ts, 22, 8)) +>idx : Symbol(idx, Decl(throwInEnclosingStatements.ts, 22, 8)) + +do { throw null; }while(true) + +var j = 0; +>j : Symbol(j, Decl(throwInEnclosingStatements.ts, 26, 3)) + +while (j < 0) { throw j; } +>j : Symbol(j, Decl(throwInEnclosingStatements.ts, 26, 3)) +>j : Symbol(j, Decl(throwInEnclosingStatements.ts, 26, 3)) + +class C { +>C : Symbol(C, Decl(throwInEnclosingStatements.ts, 27, 26)) +>T : Symbol(T, Decl(throwInEnclosingStatements.ts, 29, 8)) + + private value: T; +>value : Symbol(value, Decl(throwInEnclosingStatements.ts, 29, 12)) +>T : Symbol(T, Decl(throwInEnclosingStatements.ts, 29, 8)) + + biz() { +>biz : Symbol(biz, Decl(throwInEnclosingStatements.ts, 30, 21)) + + throw this.value; +>this.value : Symbol(value, Decl(throwInEnclosingStatements.ts, 29, 12)) +>this : Symbol(C, Decl(throwInEnclosingStatements.ts, 27, 26)) +>value : Symbol(value, Decl(throwInEnclosingStatements.ts, 29, 12)) + } + + constructor() { + throw this; +>this : Symbol(C, Decl(throwInEnclosingStatements.ts, 27, 26)) + } +} + +var aa = { +>aa : Symbol(aa, Decl(throwInEnclosingStatements.ts, 40, 3)) + + id:12, +>id : Symbol(id, Decl(throwInEnclosingStatements.ts, 40, 10)) + + biz() { +>biz : Symbol(biz, Decl(throwInEnclosingStatements.ts, 41, 10)) + + throw this; + } +} + diff --git a/tests/baselines/reference/throwInEnclosingStatements.types b/tests/baselines/reference/throwInEnclosingStatements.types new file mode 100644 index 00000000000..568fd800e35 --- /dev/null +++ b/tests/baselines/reference/throwInEnclosingStatements.types @@ -0,0 +1,110 @@ +=== tests/cases/conformance/statements/throwStatements/throwInEnclosingStatements.ts === + +function fn(x) { +>fn : (x: any) => void +>x : any + + throw x; +>x : any +} + +(x: T) => { throw x; } +>(x: T) => { throw x; } : (x: T) => void +>T : T +>x : T +>T : T +>x : T + +var y: string; +>y : string + +switch (y) { +>y : string + + case 'a': +>'a' : string + + throw y; +>y : string + + default: + throw y; +>y : string +} + +var z = 0; +>z : number +>0 : number + +while (z < 10) { +>z < 10 : boolean +>z : number +>10 : number + + throw z; +>z : number +} + +for (var i = 0; ;) { throw i; } +>i : number +>0 : number +>i : number + +for (var idx in {}) { throw idx; } +>idx : any +>{} : {} +>idx : any + +do { throw null; }while(true) +>null : null +>true : boolean + +var j = 0; +>j : number +>0 : number + +while (j < 0) { throw j; } +>j < 0 : boolean +>j : number +>0 : number +>j : number + +class C { +>C : C +>T : T + + private value: T; +>value : T +>T : T + + biz() { +>biz : () => void + + throw this.value; +>this.value : T +>this : this +>value : T + } + + constructor() { + throw this; +>this : this + } +} + +var aa = { +>aa : { id: number; biz(): void; } +>{ id:12, biz() { throw this; }} : { id: number; biz(): void; } + + id:12, +>id : number +>12 : number + + biz() { +>biz : () => void + + throw this; +>this : any + } +} + diff --git a/tests/baselines/reference/throwStatements.errors.txt b/tests/baselines/reference/throwStatements.errors.txt deleted file mode 100644 index e2e15bd503a..00000000000 --- a/tests/baselines/reference/throwStatements.errors.txt +++ /dev/null @@ -1,91 +0,0 @@ -tests/cases/conformance/statements/throwStatements/throwStatements.ts(29,1): error TS7027: Unreachable code detected. - - -==== tests/cases/conformance/statements/throwStatements/throwStatements.ts (1 errors) ==== - // all legal - - interface I { - id: number; - } - - class C implements I { - id: number; - } - - class D{ - source: T; - recurse: D; - wrapped: D> - } - - function F(x: string): number { return 42; } - - module M { - export class A { - name: string; - } - - export function F2(x: number): string { return x.toString(); } - } - - var aNumber = 9.9; - throw aNumber; - var aString = 'this is a string'; - ~~~ -!!! error TS7027: Unreachable code detected. - throw aString; - var aDate = new Date(12); - throw aDate; - var anObject = new Object(); - throw anObject; - - var anAny = null; - throw anAny; - var anOtherAny = new C(); - throw anOtherAny; - var anUndefined = undefined; - throw anUndefined; - - var aClass = new C(); - throw aClass; - var aGenericClass = new D(); - throw aGenericClass; - var anObjectLiteral = { id: 12 }; - throw anObjectLiteral; - - var aFunction = F; - throw aFunction; - throw aFunction(''); - var aLambda = (x) => 2; - throw aLambda; - throw aLambda(1); - - var aModule = M; - throw aModule; - throw typeof M; - var aClassInModule = new M.A(); - throw aClassInModule; - var aFunctionInModule = M.F2; - throw aFunctionInModule; - - // no initializer or annotation, so this is an 'any' - var x; - throw x; - - // literals - throw 0.0; - throw false; - throw null; - throw undefined; - throw 'a string'; - throw function () { return 'a string' }; - throw (x:T) => 42; - throw { x: 12, y: 13 }; - throw []; - throw ['a', ['b']]; - throw /[a-z]/; - throw new Date(); - throw new C(); - throw new Object(); - throw new D(); - \ No newline at end of file diff --git a/tests/baselines/reference/throwStatements.js b/tests/baselines/reference/throwStatements.js index 83663d08cc4..556ebc55e37 100644 --- a/tests/baselines/reference/throwStatements.js +++ b/tests/baselines/reference/throwStatements.js @@ -1,4 +1,5 @@ //// [throwStatements.ts] + // all legal interface I { diff --git a/tests/baselines/reference/throwStatements.symbols b/tests/baselines/reference/throwStatements.symbols new file mode 100644 index 00000000000..adf9cb461cf --- /dev/null +++ b/tests/baselines/reference/throwStatements.symbols @@ -0,0 +1,216 @@ +=== tests/cases/conformance/statements/throwStatements/throwStatements.ts === + +// all legal + +interface I { +>I : Symbol(I, Decl(throwStatements.ts, 0, 0)) + + id: number; +>id : Symbol(id, Decl(throwStatements.ts, 3, 13)) +} + +class C implements I { +>C : Symbol(C, Decl(throwStatements.ts, 5, 1)) +>I : Symbol(I, Decl(throwStatements.ts, 0, 0)) + + id: number; +>id : Symbol(id, Decl(throwStatements.ts, 7, 22)) +} + +class D{ +>D : Symbol(D, Decl(throwStatements.ts, 9, 1)) +>T : Symbol(T, Decl(throwStatements.ts, 11, 8)) + + source: T; +>source : Symbol(source, Decl(throwStatements.ts, 11, 11)) +>T : Symbol(T, Decl(throwStatements.ts, 11, 8)) + + recurse: D; +>recurse : Symbol(recurse, Decl(throwStatements.ts, 12, 14)) +>D : Symbol(D, Decl(throwStatements.ts, 9, 1)) +>T : Symbol(T, Decl(throwStatements.ts, 11, 8)) + + wrapped: D> +>wrapped : Symbol(wrapped, Decl(throwStatements.ts, 13, 18)) +>D : Symbol(D, Decl(throwStatements.ts, 9, 1)) +>D : Symbol(D, Decl(throwStatements.ts, 9, 1)) +>T : Symbol(T, Decl(throwStatements.ts, 11, 8)) +} + +function F(x: string): number { return 42; } +>F : Symbol(F, Decl(throwStatements.ts, 15, 1)) +>x : Symbol(x, Decl(throwStatements.ts, 17, 11)) + +module M { +>M : Symbol(M, Decl(throwStatements.ts, 17, 44)) + + export class A { +>A : Symbol(A, Decl(throwStatements.ts, 19, 10)) + + name: string; +>name : Symbol(name, Decl(throwStatements.ts, 20, 20)) + } + + export function F2(x: number): string { return x.toString(); } +>F2 : Symbol(F2, Decl(throwStatements.ts, 22, 5)) +>x : Symbol(x, Decl(throwStatements.ts, 24, 23)) +>x.toString : Symbol(Number.toString, Decl(lib.d.ts, --, --)) +>x : Symbol(x, Decl(throwStatements.ts, 24, 23)) +>toString : Symbol(Number.toString, Decl(lib.d.ts, --, --)) +} + +var aNumber = 9.9; +>aNumber : Symbol(aNumber, Decl(throwStatements.ts, 27, 3)) + +throw aNumber; +>aNumber : Symbol(aNumber, Decl(throwStatements.ts, 27, 3)) + +var aString = 'this is a string'; +>aString : Symbol(aString, Decl(throwStatements.ts, 29, 3)) + +throw aString; +>aString : Symbol(aString, Decl(throwStatements.ts, 29, 3)) + +var aDate = new Date(12); +>aDate : Symbol(aDate, Decl(throwStatements.ts, 31, 3)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) + +throw aDate; +>aDate : Symbol(aDate, Decl(throwStatements.ts, 31, 3)) + +var anObject = new Object(); +>anObject : Symbol(anObject, Decl(throwStatements.ts, 33, 3)) +>Object : Symbol(Object, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) + +throw anObject; +>anObject : Symbol(anObject, Decl(throwStatements.ts, 33, 3)) + +var anAny = null; +>anAny : Symbol(anAny, Decl(throwStatements.ts, 36, 3)) + +throw anAny; +>anAny : Symbol(anAny, Decl(throwStatements.ts, 36, 3)) + +var anOtherAny = new C(); +>anOtherAny : Symbol(anOtherAny, Decl(throwStatements.ts, 38, 3)) +>C : Symbol(C, Decl(throwStatements.ts, 5, 1)) + +throw anOtherAny; +>anOtherAny : Symbol(anOtherAny, Decl(throwStatements.ts, 38, 3)) + +var anUndefined = undefined; +>anUndefined : Symbol(anUndefined, Decl(throwStatements.ts, 40, 3)) +>undefined : Symbol(undefined) + +throw anUndefined; +>anUndefined : Symbol(anUndefined, Decl(throwStatements.ts, 40, 3)) + +var aClass = new C(); +>aClass : Symbol(aClass, Decl(throwStatements.ts, 43, 3)) +>C : Symbol(C, Decl(throwStatements.ts, 5, 1)) + +throw aClass; +>aClass : Symbol(aClass, Decl(throwStatements.ts, 43, 3)) + +var aGenericClass = new D(); +>aGenericClass : Symbol(aGenericClass, Decl(throwStatements.ts, 45, 3)) +>D : Symbol(D, Decl(throwStatements.ts, 9, 1)) + +throw aGenericClass; +>aGenericClass : Symbol(aGenericClass, Decl(throwStatements.ts, 45, 3)) + +var anObjectLiteral = { id: 12 }; +>anObjectLiteral : Symbol(anObjectLiteral, Decl(throwStatements.ts, 47, 3)) +>id : Symbol(id, Decl(throwStatements.ts, 47, 23)) + +throw anObjectLiteral; +>anObjectLiteral : Symbol(anObjectLiteral, Decl(throwStatements.ts, 47, 3)) + +var aFunction = F; +>aFunction : Symbol(aFunction, Decl(throwStatements.ts, 50, 3)) +>F : Symbol(F, Decl(throwStatements.ts, 15, 1)) + +throw aFunction; +>aFunction : Symbol(aFunction, Decl(throwStatements.ts, 50, 3)) + +throw aFunction(''); +>aFunction : Symbol(aFunction, Decl(throwStatements.ts, 50, 3)) + +var aLambda = (x) => 2; +>aLambda : Symbol(aLambda, Decl(throwStatements.ts, 53, 3)) +>x : Symbol(x, Decl(throwStatements.ts, 53, 15)) + +throw aLambda; +>aLambda : Symbol(aLambda, Decl(throwStatements.ts, 53, 3)) + +throw aLambda(1); +>aLambda : Symbol(aLambda, Decl(throwStatements.ts, 53, 3)) + +var aModule = M; +>aModule : Symbol(aModule, Decl(throwStatements.ts, 57, 3)) +>M : Symbol(M, Decl(throwStatements.ts, 17, 44)) + +throw aModule; +>aModule : Symbol(aModule, Decl(throwStatements.ts, 57, 3)) + +throw typeof M; +>M : Symbol(M, Decl(throwStatements.ts, 17, 44)) + +var aClassInModule = new M.A(); +>aClassInModule : Symbol(aClassInModule, Decl(throwStatements.ts, 60, 3)) +>M.A : Symbol(M.A, Decl(throwStatements.ts, 19, 10)) +>M : Symbol(M, Decl(throwStatements.ts, 17, 44)) +>A : Symbol(M.A, Decl(throwStatements.ts, 19, 10)) + +throw aClassInModule; +>aClassInModule : Symbol(aClassInModule, Decl(throwStatements.ts, 60, 3)) + +var aFunctionInModule = M.F2; +>aFunctionInModule : Symbol(aFunctionInModule, Decl(throwStatements.ts, 62, 3)) +>M.F2 : Symbol(M.F2, Decl(throwStatements.ts, 22, 5)) +>M : Symbol(M, Decl(throwStatements.ts, 17, 44)) +>F2 : Symbol(M.F2, Decl(throwStatements.ts, 22, 5)) + +throw aFunctionInModule; +>aFunctionInModule : Symbol(aFunctionInModule, Decl(throwStatements.ts, 62, 3)) + +// no initializer or annotation, so this is an 'any' +var x; +>x : Symbol(x, Decl(throwStatements.ts, 66, 3)) + +throw x; +>x : Symbol(x, Decl(throwStatements.ts, 66, 3)) + +// literals +throw 0.0; +throw false; +throw null; +throw undefined; +>undefined : Symbol(undefined) + +throw 'a string'; +throw function () { return 'a string' }; +throw (x:T) => 42; +>T : Symbol(T, Decl(throwStatements.ts, 76, 7)) +>x : Symbol(x, Decl(throwStatements.ts, 76, 10)) +>T : Symbol(T, Decl(throwStatements.ts, 76, 7)) + +throw { x: 12, y: 13 }; +>x : Symbol(x, Decl(throwStatements.ts, 77, 7)) +>y : Symbol(y, Decl(throwStatements.ts, 77, 14)) + +throw []; +throw ['a', ['b']]; +throw /[a-z]/; +throw new Date(); +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) + +throw new C(); +>C : Symbol(C, Decl(throwStatements.ts, 5, 1)) + +throw new Object(); +>Object : Symbol(Object, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) + +throw new D(); +>D : Symbol(D, Decl(throwStatements.ts, 9, 1)) + diff --git a/tests/baselines/reference/throwStatements.types b/tests/baselines/reference/throwStatements.types new file mode 100644 index 00000000000..5023513ee53 --- /dev/null +++ b/tests/baselines/reference/throwStatements.types @@ -0,0 +1,267 @@ +=== tests/cases/conformance/statements/throwStatements/throwStatements.ts === + +// all legal + +interface I { +>I : I + + id: number; +>id : number +} + +class C implements I { +>C : C +>I : I + + id: number; +>id : number +} + +class D{ +>D : D +>T : T + + source: T; +>source : T +>T : T + + recurse: D; +>recurse : D +>D : D +>T : T + + wrapped: D> +>wrapped : D> +>D : D +>D : D +>T : T +} + +function F(x: string): number { return 42; } +>F : (x: string) => number +>x : string +>42 : number + +module M { +>M : typeof M + + export class A { +>A : A + + name: string; +>name : string + } + + export function F2(x: number): string { return x.toString(); } +>F2 : (x: number) => string +>x : number +>x.toString() : string +>x.toString : (radix?: number) => string +>x : number +>toString : (radix?: number) => string +} + +var aNumber = 9.9; +>aNumber : number +>9.9 : number + +throw aNumber; +>aNumber : number + +var aString = 'this is a string'; +>aString : string +>'this is a string' : string + +throw aString; +>aString : string + +var aDate = new Date(12); +>aDate : Date +>new Date(12) : Date +>Date : DateConstructor +>12 : number + +throw aDate; +>aDate : Date + +var anObject = new Object(); +>anObject : Object +>new Object() : Object +>Object : ObjectConstructor + +throw anObject; +>anObject : Object + +var anAny = null; +>anAny : any +>null : null + +throw anAny; +>anAny : any + +var anOtherAny = new C(); +>anOtherAny : any +> new C() : any +>new C() : C +>C : typeof C + +throw anOtherAny; +>anOtherAny : any + +var anUndefined = undefined; +>anUndefined : any +>undefined : undefined + +throw anUndefined; +>anUndefined : any + +var aClass = new C(); +>aClass : C +>new C() : C +>C : typeof C + +throw aClass; +>aClass : C + +var aGenericClass = new D(); +>aGenericClass : D +>new D() : D +>D : typeof D + +throw aGenericClass; +>aGenericClass : D + +var anObjectLiteral = { id: 12 }; +>anObjectLiteral : { id: number; } +>{ id: 12 } : { id: number; } +>id : number +>12 : number + +throw anObjectLiteral; +>anObjectLiteral : { id: number; } + +var aFunction = F; +>aFunction : (x: string) => number +>F : (x: string) => number + +throw aFunction; +>aFunction : (x: string) => number + +throw aFunction(''); +>aFunction('') : number +>aFunction : (x: string) => number +>'' : string + +var aLambda = (x) => 2; +>aLambda : (x: any) => number +>(x) => 2 : (x: any) => number +>x : any +>2 : number + +throw aLambda; +>aLambda : (x: any) => number + +throw aLambda(1); +>aLambda(1) : number +>aLambda : (x: any) => number +>1 : number + +var aModule = M; +>aModule : typeof M +>M : typeof M + +throw aModule; +>aModule : typeof M + +throw typeof M; +>typeof M : string +>M : typeof M + +var aClassInModule = new M.A(); +>aClassInModule : M.A +>new M.A() : M.A +>M.A : typeof M.A +>M : typeof M +>A : typeof M.A + +throw aClassInModule; +>aClassInModule : M.A + +var aFunctionInModule = M.F2; +>aFunctionInModule : (x: number) => string +>M.F2 : (x: number) => string +>M : typeof M +>F2 : (x: number) => string + +throw aFunctionInModule; +>aFunctionInModule : (x: number) => string + +// no initializer or annotation, so this is an 'any' +var x; +>x : any + +throw x; +>x : any + +// literals +throw 0.0; +>0.0 : number + +throw false; +>false : boolean + +throw null; +>null : null + +throw undefined; +>undefined : undefined + +throw 'a string'; +>'a string' : string + +throw function () { return 'a string' }; +>function () { return 'a string' } : () => string +>'a string' : string + +throw (x:T) => 42; +>(x:T) => 42 : (x: T) => number +>T : T +>x : T +>T : T +>42 : number + +throw { x: 12, y: 13 }; +>{ x: 12, y: 13 } : { x: number; y: number; } +>x : number +>12 : number +>y : number +>13 : number + +throw []; +>[] : undefined[] + +throw ['a', ['b']]; +>['a', ['b']] : (string | string[])[] +>'a' : string +>['b'] : string[] +>'b' : string + +throw /[a-z]/; +>/[a-z]/ : RegExp + +throw new Date(); +>new Date() : Date +>Date : DateConstructor + +throw new C(); +>new C() : C +>C : typeof C + +throw new Object(); +>new Object() : Object +>Object : ObjectConstructor + +throw new D(); +>new D() : D +>D : typeof D + diff --git a/tests/baselines/reference/typeofOperatorWithBooleanType.errors.txt b/tests/baselines/reference/typeofOperatorWithBooleanType.errors.txt deleted file mode 100644 index 9c4e2495660..00000000000 --- a/tests/baselines/reference/typeofOperatorWithBooleanType.errors.txt +++ /dev/null @@ -1,59 +0,0 @@ -tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithBooleanType.ts(44,1): error TS7028: Unused label. -tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithBooleanType.ts(45,1): error TS7028: Unused label. - - -==== tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithBooleanType.ts (2 errors) ==== - // typeof operator on boolean type - var BOOLEAN: boolean; - - function foo(): boolean { return true; } - - class A { - public a: boolean; - static foo() { return false; } - } - module M { - export var n: boolean; - } - - var objA = new A(); - - // boolean type var - var ResultIsString1 = typeof BOOLEAN; - - // boolean type literal - var ResultIsString2 = typeof true; - var ResultIsString3 = typeof { x: true, y: false }; - - // boolean type expressions - var ResultIsString4 = typeof objA.a; - var ResultIsString5 = typeof M.n; - var ResultIsString6 = typeof foo(); - var ResultIsString7 = typeof A.foo(); - - // multiple typeof operator - var ResultIsString8 = typeof typeof BOOLEAN; - - // miss assignment operators - typeof true; - typeof BOOLEAN; - typeof foo(); - typeof true, false; - typeof objA.a; - typeof M.n; - - // use typeof in type query - var z: boolean; - var x: boolean[]; - var r: () => boolean; - z: typeof BOOLEAN; - ~ -!!! error TS7028: Unused label. - r: typeof foo; - ~ -!!! error TS7028: Unused label. - var y = { a: true, b: false}; - z: typeof y.a; - z: typeof objA.a; - z: typeof A.foo; - z: typeof M.n; \ No newline at end of file diff --git a/tests/baselines/reference/typeofOperatorWithBooleanType.js b/tests/baselines/reference/typeofOperatorWithBooleanType.js index c0538b78b14..b9db33b11a4 100644 --- a/tests/baselines/reference/typeofOperatorWithBooleanType.js +++ b/tests/baselines/reference/typeofOperatorWithBooleanType.js @@ -1,4 +1,5 @@ //// [typeofOperatorWithBooleanType.ts] + // typeof operator on boolean type var BOOLEAN: boolean; diff --git a/tests/baselines/reference/typeofOperatorWithBooleanType.symbols b/tests/baselines/reference/typeofOperatorWithBooleanType.symbols new file mode 100644 index 00000000000..0167a14ae03 --- /dev/null +++ b/tests/baselines/reference/typeofOperatorWithBooleanType.symbols @@ -0,0 +1,131 @@ +=== tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithBooleanType.ts === + +// typeof operator on boolean type +var BOOLEAN: boolean; +>BOOLEAN : Symbol(BOOLEAN, Decl(typeofOperatorWithBooleanType.ts, 2, 3)) + +function foo(): boolean { return true; } +>foo : Symbol(foo, Decl(typeofOperatorWithBooleanType.ts, 2, 21)) + +class A { +>A : Symbol(A, Decl(typeofOperatorWithBooleanType.ts, 4, 40)) + + public a: boolean; +>a : Symbol(a, Decl(typeofOperatorWithBooleanType.ts, 6, 9)) + + static foo() { return false; } +>foo : Symbol(A.foo, Decl(typeofOperatorWithBooleanType.ts, 7, 22)) +} +module M { +>M : Symbol(M, Decl(typeofOperatorWithBooleanType.ts, 9, 1)) + + export var n: boolean; +>n : Symbol(n, Decl(typeofOperatorWithBooleanType.ts, 11, 14)) +} + +var objA = new A(); +>objA : Symbol(objA, Decl(typeofOperatorWithBooleanType.ts, 14, 3)) +>A : Symbol(A, Decl(typeofOperatorWithBooleanType.ts, 4, 40)) + +// boolean type var +var ResultIsString1 = typeof BOOLEAN; +>ResultIsString1 : Symbol(ResultIsString1, Decl(typeofOperatorWithBooleanType.ts, 17, 3)) +>BOOLEAN : Symbol(BOOLEAN, Decl(typeofOperatorWithBooleanType.ts, 2, 3)) + +// boolean type literal +var ResultIsString2 = typeof true; +>ResultIsString2 : Symbol(ResultIsString2, Decl(typeofOperatorWithBooleanType.ts, 20, 3)) + +var ResultIsString3 = typeof { x: true, y: false }; +>ResultIsString3 : Symbol(ResultIsString3, Decl(typeofOperatorWithBooleanType.ts, 21, 3)) +>x : Symbol(x, Decl(typeofOperatorWithBooleanType.ts, 21, 30)) +>y : Symbol(y, Decl(typeofOperatorWithBooleanType.ts, 21, 39)) + +// boolean type expressions +var ResultIsString4 = typeof objA.a; +>ResultIsString4 : Symbol(ResultIsString4, Decl(typeofOperatorWithBooleanType.ts, 24, 3)) +>objA.a : Symbol(A.a, Decl(typeofOperatorWithBooleanType.ts, 6, 9)) +>objA : Symbol(objA, Decl(typeofOperatorWithBooleanType.ts, 14, 3)) +>a : Symbol(A.a, Decl(typeofOperatorWithBooleanType.ts, 6, 9)) + +var ResultIsString5 = typeof M.n; +>ResultIsString5 : Symbol(ResultIsString5, Decl(typeofOperatorWithBooleanType.ts, 25, 3)) +>M.n : Symbol(M.n, Decl(typeofOperatorWithBooleanType.ts, 11, 14)) +>M : Symbol(M, Decl(typeofOperatorWithBooleanType.ts, 9, 1)) +>n : Symbol(M.n, Decl(typeofOperatorWithBooleanType.ts, 11, 14)) + +var ResultIsString6 = typeof foo(); +>ResultIsString6 : Symbol(ResultIsString6, Decl(typeofOperatorWithBooleanType.ts, 26, 3)) +>foo : Symbol(foo, Decl(typeofOperatorWithBooleanType.ts, 2, 21)) + +var ResultIsString7 = typeof A.foo(); +>ResultIsString7 : Symbol(ResultIsString7, Decl(typeofOperatorWithBooleanType.ts, 27, 3)) +>A.foo : Symbol(A.foo, Decl(typeofOperatorWithBooleanType.ts, 7, 22)) +>A : Symbol(A, Decl(typeofOperatorWithBooleanType.ts, 4, 40)) +>foo : Symbol(A.foo, Decl(typeofOperatorWithBooleanType.ts, 7, 22)) + +// multiple typeof operator +var ResultIsString8 = typeof typeof BOOLEAN; +>ResultIsString8 : Symbol(ResultIsString8, Decl(typeofOperatorWithBooleanType.ts, 30, 3)) +>BOOLEAN : Symbol(BOOLEAN, Decl(typeofOperatorWithBooleanType.ts, 2, 3)) + +// miss assignment operators +typeof true; +typeof BOOLEAN; +>BOOLEAN : Symbol(BOOLEAN, Decl(typeofOperatorWithBooleanType.ts, 2, 3)) + +typeof foo(); +>foo : Symbol(foo, Decl(typeofOperatorWithBooleanType.ts, 2, 21)) + +typeof true, false; +typeof objA.a; +>objA.a : Symbol(A.a, Decl(typeofOperatorWithBooleanType.ts, 6, 9)) +>objA : Symbol(objA, Decl(typeofOperatorWithBooleanType.ts, 14, 3)) +>a : Symbol(A.a, Decl(typeofOperatorWithBooleanType.ts, 6, 9)) + +typeof M.n; +>M.n : Symbol(M.n, Decl(typeofOperatorWithBooleanType.ts, 11, 14)) +>M : Symbol(M, Decl(typeofOperatorWithBooleanType.ts, 9, 1)) +>n : Symbol(M.n, Decl(typeofOperatorWithBooleanType.ts, 11, 14)) + +// use typeof in type query +var z: boolean; +>z : Symbol(z, Decl(typeofOperatorWithBooleanType.ts, 41, 3)) + +var x: boolean[]; +>x : Symbol(x, Decl(typeofOperatorWithBooleanType.ts, 42, 3)) + +var r: () => boolean; +>r : Symbol(r, Decl(typeofOperatorWithBooleanType.ts, 43, 3)) + +z: typeof BOOLEAN; +>BOOLEAN : Symbol(BOOLEAN, Decl(typeofOperatorWithBooleanType.ts, 2, 3)) + +r: typeof foo; +>foo : Symbol(foo, Decl(typeofOperatorWithBooleanType.ts, 2, 21)) + +var y = { a: true, b: false}; +>y : Symbol(y, Decl(typeofOperatorWithBooleanType.ts, 46, 3)) +>a : Symbol(a, Decl(typeofOperatorWithBooleanType.ts, 46, 9)) +>b : Symbol(b, Decl(typeofOperatorWithBooleanType.ts, 46, 18)) + +z: typeof y.a; +>y.a : Symbol(a, Decl(typeofOperatorWithBooleanType.ts, 46, 9)) +>y : Symbol(y, Decl(typeofOperatorWithBooleanType.ts, 46, 3)) +>a : Symbol(a, Decl(typeofOperatorWithBooleanType.ts, 46, 9)) + +z: typeof objA.a; +>objA.a : Symbol(A.a, Decl(typeofOperatorWithBooleanType.ts, 6, 9)) +>objA : Symbol(objA, Decl(typeofOperatorWithBooleanType.ts, 14, 3)) +>a : Symbol(A.a, Decl(typeofOperatorWithBooleanType.ts, 6, 9)) + +z: typeof A.foo; +>A.foo : Symbol(A.foo, Decl(typeofOperatorWithBooleanType.ts, 7, 22)) +>A : Symbol(A, Decl(typeofOperatorWithBooleanType.ts, 4, 40)) +>foo : Symbol(A.foo, Decl(typeofOperatorWithBooleanType.ts, 7, 22)) + +z: typeof M.n; +>M.n : Symbol(M.n, Decl(typeofOperatorWithBooleanType.ts, 11, 14)) +>M : Symbol(M, Decl(typeofOperatorWithBooleanType.ts, 9, 1)) +>n : Symbol(M.n, Decl(typeofOperatorWithBooleanType.ts, 11, 14)) + diff --git a/tests/baselines/reference/typeofOperatorWithBooleanType.types b/tests/baselines/reference/typeofOperatorWithBooleanType.types new file mode 100644 index 00000000000..043307cfb00 --- /dev/null +++ b/tests/baselines/reference/typeofOperatorWithBooleanType.types @@ -0,0 +1,177 @@ +=== tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithBooleanType.ts === + +// typeof operator on boolean type +var BOOLEAN: boolean; +>BOOLEAN : boolean + +function foo(): boolean { return true; } +>foo : () => boolean +>true : boolean + +class A { +>A : A + + public a: boolean; +>a : boolean + + static foo() { return false; } +>foo : () => boolean +>false : boolean +} +module M { +>M : typeof M + + export var n: boolean; +>n : boolean +} + +var objA = new A(); +>objA : A +>new A() : A +>A : typeof A + +// boolean type var +var ResultIsString1 = typeof BOOLEAN; +>ResultIsString1 : string +>typeof BOOLEAN : string +>BOOLEAN : boolean + +// boolean type literal +var ResultIsString2 = typeof true; +>ResultIsString2 : string +>typeof true : string +>true : boolean + +var ResultIsString3 = typeof { x: true, y: false }; +>ResultIsString3 : string +>typeof { x: true, y: false } : string +>{ x: true, y: false } : { x: boolean; y: boolean; } +>x : boolean +>true : boolean +>y : boolean +>false : boolean + +// boolean type expressions +var ResultIsString4 = typeof objA.a; +>ResultIsString4 : string +>typeof objA.a : string +>objA.a : boolean +>objA : A +>a : boolean + +var ResultIsString5 = typeof M.n; +>ResultIsString5 : string +>typeof M.n : string +>M.n : boolean +>M : typeof M +>n : boolean + +var ResultIsString6 = typeof foo(); +>ResultIsString6 : string +>typeof foo() : string +>foo() : boolean +>foo : () => boolean + +var ResultIsString7 = typeof A.foo(); +>ResultIsString7 : string +>typeof A.foo() : string +>A.foo() : boolean +>A.foo : () => boolean +>A : typeof A +>foo : () => boolean + +// multiple typeof operator +var ResultIsString8 = typeof typeof BOOLEAN; +>ResultIsString8 : string +>typeof typeof BOOLEAN : string +>typeof BOOLEAN : string +>BOOLEAN : boolean + +// miss assignment operators +typeof true; +>typeof true : string +>true : boolean + +typeof BOOLEAN; +>typeof BOOLEAN : string +>BOOLEAN : boolean + +typeof foo(); +>typeof foo() : string +>foo() : boolean +>foo : () => boolean + +typeof true, false; +>typeof true, false : boolean +>typeof true : string +>true : boolean +>false : boolean + +typeof objA.a; +>typeof objA.a : string +>objA.a : boolean +>objA : A +>a : boolean + +typeof M.n; +>typeof M.n : string +>M.n : boolean +>M : typeof M +>n : boolean + +// use typeof in type query +var z: boolean; +>z : boolean + +var x: boolean[]; +>x : boolean[] + +var r: () => boolean; +>r : () => boolean + +z: typeof BOOLEAN; +>z : any +>typeof BOOLEAN : string +>BOOLEAN : boolean + +r: typeof foo; +>r : any +>typeof foo : string +>foo : () => boolean + +var y = { a: true, b: false}; +>y : { a: boolean; b: boolean; } +>{ a: true, b: false} : { a: boolean; b: boolean; } +>a : boolean +>true : boolean +>b : boolean +>false : boolean + +z: typeof y.a; +>z : any +>typeof y.a : string +>y.a : boolean +>y : { a: boolean; b: boolean; } +>a : boolean + +z: typeof objA.a; +>z : any +>typeof objA.a : string +>objA.a : boolean +>objA : A +>a : boolean + +z: typeof A.foo; +>z : any +>typeof A.foo : string +>A.foo : () => boolean +>A : typeof A +>foo : () => boolean + +z: typeof M.n; +>z : any +>typeof M.n : string +>M.n : boolean +>M : typeof M +>n : boolean + diff --git a/tests/baselines/reference/typeofOperatorWithEnumType.errors.txt b/tests/baselines/reference/typeofOperatorWithEnumType.errors.txt deleted file mode 100644 index 6e473b7487d..00000000000 --- a/tests/baselines/reference/typeofOperatorWithEnumType.errors.txt +++ /dev/null @@ -1,33 +0,0 @@ -tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithEnumType.ts(26,1): error TS7028: Unused label. - - -==== tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithEnumType.ts (1 errors) ==== - // typeof operator on enum type - - enum ENUM { }; - enum ENUM1 { A, B, "" }; - - // enum type var - var ResultIsString1 = typeof ENUM; - var ResultIsString2 = typeof ENUM1; - - // enum type expressions - var ResultIsString3 = typeof ENUM1["A"]; - var ResultIsString4 = typeof (ENUM[0] + ENUM1["B"]); - - // multiple typeof operators - var ResultIsString5 = typeof typeof ENUM; - var ResultIsString6 = typeof typeof typeof (ENUM[0] + ENUM1.B); - - // miss assignment operators - typeof ENUM; - typeof ENUM1; - typeof ENUM1["B"]; - typeof ENUM, ENUM1; - - // use typeof in type query - enum z { }; - z: typeof ENUM; - ~ -!!! error TS7028: Unused label. - z: typeof ENUM1; \ No newline at end of file diff --git a/tests/baselines/reference/typeofOperatorWithEnumType.js b/tests/baselines/reference/typeofOperatorWithEnumType.js index 2e2963b0955..2ce32668186 100644 --- a/tests/baselines/reference/typeofOperatorWithEnumType.js +++ b/tests/baselines/reference/typeofOperatorWithEnumType.js @@ -1,4 +1,5 @@ //// [typeofOperatorWithEnumType.ts] + // typeof operator on enum type enum ENUM { }; diff --git a/tests/baselines/reference/typeofOperatorWithEnumType.symbols b/tests/baselines/reference/typeofOperatorWithEnumType.symbols new file mode 100644 index 00000000000..a8e3d6d351f --- /dev/null +++ b/tests/baselines/reference/typeofOperatorWithEnumType.symbols @@ -0,0 +1,70 @@ +=== tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithEnumType.ts === + +// typeof operator on enum type + +enum ENUM { }; +>ENUM : Symbol(ENUM, Decl(typeofOperatorWithEnumType.ts, 0, 0)) + +enum ENUM1 { A, B, "" }; +>ENUM1 : Symbol(ENUM1, Decl(typeofOperatorWithEnumType.ts, 3, 14)) +>A : Symbol(ENUM1.A, Decl(typeofOperatorWithEnumType.ts, 4, 12)) +>B : Symbol(ENUM1.B, Decl(typeofOperatorWithEnumType.ts, 4, 15)) + +// enum type var +var ResultIsString1 = typeof ENUM; +>ResultIsString1 : Symbol(ResultIsString1, Decl(typeofOperatorWithEnumType.ts, 7, 3)) +>ENUM : Symbol(ENUM, Decl(typeofOperatorWithEnumType.ts, 0, 0)) + +var ResultIsString2 = typeof ENUM1; +>ResultIsString2 : Symbol(ResultIsString2, Decl(typeofOperatorWithEnumType.ts, 8, 3)) +>ENUM1 : Symbol(ENUM1, Decl(typeofOperatorWithEnumType.ts, 3, 14)) + +// enum type expressions +var ResultIsString3 = typeof ENUM1["A"]; +>ResultIsString3 : Symbol(ResultIsString3, Decl(typeofOperatorWithEnumType.ts, 11, 3)) +>ENUM1 : Symbol(ENUM1, Decl(typeofOperatorWithEnumType.ts, 3, 14)) +>"A" : Symbol(ENUM1.A, Decl(typeofOperatorWithEnumType.ts, 4, 12)) + +var ResultIsString4 = typeof (ENUM[0] + ENUM1["B"]); +>ResultIsString4 : Symbol(ResultIsString4, Decl(typeofOperatorWithEnumType.ts, 12, 3)) +>ENUM : Symbol(ENUM, Decl(typeofOperatorWithEnumType.ts, 0, 0)) +>ENUM1 : Symbol(ENUM1, Decl(typeofOperatorWithEnumType.ts, 3, 14)) +>"B" : Symbol(ENUM1.B, Decl(typeofOperatorWithEnumType.ts, 4, 15)) + +// multiple typeof operators +var ResultIsString5 = typeof typeof ENUM; +>ResultIsString5 : Symbol(ResultIsString5, Decl(typeofOperatorWithEnumType.ts, 15, 3)) +>ENUM : Symbol(ENUM, Decl(typeofOperatorWithEnumType.ts, 0, 0)) + +var ResultIsString6 = typeof typeof typeof (ENUM[0] + ENUM1.B); +>ResultIsString6 : Symbol(ResultIsString6, Decl(typeofOperatorWithEnumType.ts, 16, 3)) +>ENUM : Symbol(ENUM, Decl(typeofOperatorWithEnumType.ts, 0, 0)) +>ENUM1.B : Symbol(ENUM1.B, Decl(typeofOperatorWithEnumType.ts, 4, 15)) +>ENUM1 : Symbol(ENUM1, Decl(typeofOperatorWithEnumType.ts, 3, 14)) +>B : Symbol(ENUM1.B, Decl(typeofOperatorWithEnumType.ts, 4, 15)) + +// miss assignment operators +typeof ENUM; +>ENUM : Symbol(ENUM, Decl(typeofOperatorWithEnumType.ts, 0, 0)) + +typeof ENUM1; +>ENUM1 : Symbol(ENUM1, Decl(typeofOperatorWithEnumType.ts, 3, 14)) + +typeof ENUM1["B"]; +>ENUM1 : Symbol(ENUM1, Decl(typeofOperatorWithEnumType.ts, 3, 14)) +>"B" : Symbol(ENUM1.B, Decl(typeofOperatorWithEnumType.ts, 4, 15)) + +typeof ENUM, ENUM1; +>ENUM : Symbol(ENUM, Decl(typeofOperatorWithEnumType.ts, 0, 0)) +>ENUM1 : Symbol(ENUM1, Decl(typeofOperatorWithEnumType.ts, 3, 14)) + +// use typeof in type query +enum z { }; +>z : Symbol(z, Decl(typeofOperatorWithEnumType.ts, 22, 19)) + +z: typeof ENUM; +>ENUM : Symbol(ENUM, Decl(typeofOperatorWithEnumType.ts, 0, 0)) + +z: typeof ENUM1; +>ENUM1 : Symbol(ENUM1, Decl(typeofOperatorWithEnumType.ts, 3, 14)) + diff --git a/tests/baselines/reference/typeofOperatorWithEnumType.types b/tests/baselines/reference/typeofOperatorWithEnumType.types new file mode 100644 index 00000000000..f9224811393 --- /dev/null +++ b/tests/baselines/reference/typeofOperatorWithEnumType.types @@ -0,0 +1,99 @@ +=== tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithEnumType.ts === + +// typeof operator on enum type + +enum ENUM { }; +>ENUM : ENUM + +enum ENUM1 { A, B, "" }; +>ENUM1 : ENUM1 +>A : ENUM1 +>B : ENUM1 + +// enum type var +var ResultIsString1 = typeof ENUM; +>ResultIsString1 : string +>typeof ENUM : string +>ENUM : typeof ENUM + +var ResultIsString2 = typeof ENUM1; +>ResultIsString2 : string +>typeof ENUM1 : string +>ENUM1 : typeof ENUM1 + +// enum type expressions +var ResultIsString3 = typeof ENUM1["A"]; +>ResultIsString3 : string +>typeof ENUM1["A"] : string +>ENUM1["A"] : ENUM1 +>ENUM1 : typeof ENUM1 +>"A" : string + +var ResultIsString4 = typeof (ENUM[0] + ENUM1["B"]); +>ResultIsString4 : string +>typeof (ENUM[0] + ENUM1["B"]) : string +>(ENUM[0] + ENUM1["B"]) : string +>ENUM[0] + ENUM1["B"] : string +>ENUM[0] : string +>ENUM : typeof ENUM +>0 : number +>ENUM1["B"] : ENUM1 +>ENUM1 : typeof ENUM1 +>"B" : string + +// multiple typeof operators +var ResultIsString5 = typeof typeof ENUM; +>ResultIsString5 : string +>typeof typeof ENUM : string +>typeof ENUM : string +>ENUM : typeof ENUM + +var ResultIsString6 = typeof typeof typeof (ENUM[0] + ENUM1.B); +>ResultIsString6 : string +>typeof typeof typeof (ENUM[0] + ENUM1.B) : string +>typeof typeof (ENUM[0] + ENUM1.B) : string +>typeof (ENUM[0] + ENUM1.B) : string +>(ENUM[0] + ENUM1.B) : string +>ENUM[0] + ENUM1.B : string +>ENUM[0] : string +>ENUM : typeof ENUM +>0 : number +>ENUM1.B : ENUM1 +>ENUM1 : typeof ENUM1 +>B : ENUM1 + +// miss assignment operators +typeof ENUM; +>typeof ENUM : string +>ENUM : typeof ENUM + +typeof ENUM1; +>typeof ENUM1 : string +>ENUM1 : typeof ENUM1 + +typeof ENUM1["B"]; +>typeof ENUM1["B"] : string +>ENUM1["B"] : ENUM1 +>ENUM1 : typeof ENUM1 +>"B" : string + +typeof ENUM, ENUM1; +>typeof ENUM, ENUM1 : typeof ENUM1 +>typeof ENUM : string +>ENUM : typeof ENUM +>ENUM1 : typeof ENUM1 + +// use typeof in type query +enum z { }; +>z : z + +z: typeof ENUM; +>z : any +>typeof ENUM : string +>ENUM : typeof ENUM + +z: typeof ENUM1; +>z : any +>typeof ENUM1 : string +>ENUM1 : typeof ENUM1 + diff --git a/tests/cases/compiler/commentsAtEndOfFile1.ts b/tests/cases/compiler/commentsAtEndOfFile1.ts index 8e37b2361a5..04c90b3433a 100644 --- a/tests/cases/compiler/commentsAtEndOfFile1.ts +++ b/tests/cases/compiler/commentsAtEndOfFile1.ts @@ -1,3 +1,5 @@ +// @allowUnusedLabels: true + Input: ; //Testing two diff --git a/tests/cases/compiler/recursiveMods.ts b/tests/cases/compiler/recursiveMods.ts index fa07646ba72..84dbafff558 100644 --- a/tests/cases/compiler/recursiveMods.ts +++ b/tests/cases/compiler/recursiveMods.ts @@ -1,4 +1,6 @@ -//@module: commonjs +// @allowUnreachableCode: true +// @module: commonjs + export module Foo { export class C {} } diff --git a/tests/cases/compiler/returnStatement1.ts b/tests/cases/compiler/returnStatement1.ts index e87635b37d7..06d1bdb9569 100644 --- a/tests/cases/compiler/returnStatement1.ts +++ b/tests/cases/compiler/returnStatement1.ts @@ -1,3 +1,5 @@ +// @allowUnreachableCode: true + function f() { return function (s) { var x = s; diff --git a/tests/cases/compiler/sourceMapValidationLabeled.ts b/tests/cases/compiler/sourceMapValidationLabeled.ts index 5993e82aacc..e36bdd9a0b3 100644 --- a/tests/cases/compiler/sourceMapValidationLabeled.ts +++ b/tests/cases/compiler/sourceMapValidationLabeled.ts @@ -1,3 +1,5 @@ +// @allowUnusedLabels: true // @sourcemap: true + x: var b = 10; \ No newline at end of file diff --git a/tests/cases/compiler/systemModule8.ts b/tests/cases/compiler/systemModule8.ts index c3e0c7c7437..4490b2a8529 100644 --- a/tests/cases/compiler/systemModule8.ts +++ b/tests/cases/compiler/systemModule8.ts @@ -1,3 +1,4 @@ +// @allowUnreachableCode: true // @module: system export var x; diff --git a/tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithBooleanType.ts b/tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithBooleanType.ts index 00460181c2b..c22ed94087b 100644 --- a/tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithBooleanType.ts +++ b/tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithBooleanType.ts @@ -1,3 +1,5 @@ +// @allowUnusedLabels: true + // typeof operator on boolean type var BOOLEAN: boolean; diff --git a/tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithEnumType.ts b/tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithEnumType.ts index 9abb602db06..57b22e3646c 100644 --- a/tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithEnumType.ts +++ b/tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithEnumType.ts @@ -1,3 +1,5 @@ +// @allowUnusedLabels: true + // typeof operator on enum type enum ENUM { }; diff --git a/tests/cases/conformance/parser/ecmascript5/Statements/BreakStatements/parser_breakTarget3.ts b/tests/cases/conformance/parser/ecmascript5/Statements/BreakStatements/parser_breakTarget3.ts index 9cef599692c..64a9357706f 100644 --- a/tests/cases/conformance/parser/ecmascript5/Statements/BreakStatements/parser_breakTarget3.ts +++ b/tests/cases/conformance/parser/ecmascript5/Statements/BreakStatements/parser_breakTarget3.ts @@ -1,3 +1,5 @@ +// @allowUnusedLabels: true + target1: target2: while (true) { diff --git a/tests/cases/conformance/parser/ecmascript5/Statements/BreakStatements/parser_breakTarget4.ts b/tests/cases/conformance/parser/ecmascript5/Statements/BreakStatements/parser_breakTarget4.ts index 2c3eadca7db..3e00bca659b 100644 --- a/tests/cases/conformance/parser/ecmascript5/Statements/BreakStatements/parser_breakTarget4.ts +++ b/tests/cases/conformance/parser/ecmascript5/Statements/BreakStatements/parser_breakTarget4.ts @@ -1,3 +1,5 @@ +// @allowUnusedLabels: true + target1: target2: while (true) { diff --git a/tests/cases/conformance/parser/ecmascript5/Statements/ContinueStatements/parser_continueTarget3.ts b/tests/cases/conformance/parser/ecmascript5/Statements/ContinueStatements/parser_continueTarget3.ts index 26bea241a7a..a7b47ff071b 100644 --- a/tests/cases/conformance/parser/ecmascript5/Statements/ContinueStatements/parser_continueTarget3.ts +++ b/tests/cases/conformance/parser/ecmascript5/Statements/ContinueStatements/parser_continueTarget3.ts @@ -1,3 +1,5 @@ +// @allowUnusedLabels: true + target1: target2: while (true) { diff --git a/tests/cases/conformance/parser/ecmascript5/Statements/ContinueStatements/parser_continueTarget4.ts b/tests/cases/conformance/parser/ecmascript5/Statements/ContinueStatements/parser_continueTarget4.ts index e00c222aa9c..5ba2bd69b11 100644 --- a/tests/cases/conformance/parser/ecmascript5/Statements/ContinueStatements/parser_continueTarget4.ts +++ b/tests/cases/conformance/parser/ecmascript5/Statements/ContinueStatements/parser_continueTarget4.ts @@ -1,3 +1,5 @@ +// @allowUnusedLabels: true + target1: target2: while (true) { diff --git a/tests/cases/conformance/parser/ecmascript5/Statements/LabeledStatements/parser_duplicateLabel3.ts b/tests/cases/conformance/parser/ecmascript5/Statements/LabeledStatements/parser_duplicateLabel3.ts index d4db9399ed2..d6add980447 100644 --- a/tests/cases/conformance/parser/ecmascript5/Statements/LabeledStatements/parser_duplicateLabel3.ts +++ b/tests/cases/conformance/parser/ecmascript5/Statements/LabeledStatements/parser_duplicateLabel3.ts @@ -1,3 +1,5 @@ +// @allowUnusedLabels: true + target: while (true) { function f() { diff --git a/tests/cases/conformance/parser/ecmascript5/Statements/LabeledStatements/parser_duplicateLabel4.ts b/tests/cases/conformance/parser/ecmascript5/Statements/LabeledStatements/parser_duplicateLabel4.ts index 2c62180a2ab..bf7ea5c22c6 100644 --- a/tests/cases/conformance/parser/ecmascript5/Statements/LabeledStatements/parser_duplicateLabel4.ts +++ b/tests/cases/conformance/parser/ecmascript5/Statements/LabeledStatements/parser_duplicateLabel4.ts @@ -1,3 +1,6 @@ +// @allowUnusedLabels: true +// @allowUnreachableCode: true + target: while (true) { } diff --git a/tests/cases/conformance/statements/breakStatements/switchBreakStatements.ts b/tests/cases/conformance/statements/breakStatements/switchBreakStatements.ts index f5ce6ffa52f..3080a6b38a8 100644 --- a/tests/cases/conformance/statements/breakStatements/switchBreakStatements.ts +++ b/tests/cases/conformance/statements/breakStatements/switchBreakStatements.ts @@ -1,3 +1,6 @@ +// @allowUnusedLabels: true +// @allowUnreachableCode: true + switch ('') { case 'a': break; diff --git a/tests/cases/conformance/statements/throwStatements/throwInEnclosingStatements.ts b/tests/cases/conformance/statements/throwStatements/throwInEnclosingStatements.ts index 4b9675f9d63..c5875327b50 100644 --- a/tests/cases/conformance/statements/throwStatements/throwInEnclosingStatements.ts +++ b/tests/cases/conformance/statements/throwStatements/throwInEnclosingStatements.ts @@ -1,3 +1,5 @@ +// @allowUnreachableCode: true + function fn(x) { throw x; } diff --git a/tests/cases/conformance/statements/throwStatements/throwStatements.ts b/tests/cases/conformance/statements/throwStatements/throwStatements.ts index 8d155cbc8cf..07c09da93fc 100644 --- a/tests/cases/conformance/statements/throwStatements/throwStatements.ts +++ b/tests/cases/conformance/statements/throwStatements/throwStatements.ts @@ -1,3 +1,5 @@ +// @allowUnreachableCode: true + // all legal interface I {