diff --git a/tests/baselines/reference/ExportAssignment7.js b/tests/baselines/reference/ExportAssignment7.js deleted file mode 100644 index ce4f5d7bf09..00000000000 --- a/tests/baselines/reference/ExportAssignment7.js +++ /dev/null @@ -1,13 +0,0 @@ -//// [ExportAssignment7.ts] -export class C { -} - -export = B; - -//// [ExportAssignment7.js] -var C = (function () { - function C() { - } - return C; -})(); -exports.C = C; diff --git a/tests/baselines/reference/ExportAssignment8.js b/tests/baselines/reference/ExportAssignment8.js deleted file mode 100644 index 2f7ac9ee69f..00000000000 --- a/tests/baselines/reference/ExportAssignment8.js +++ /dev/null @@ -1,13 +0,0 @@ -//// [ExportAssignment8.ts] -export = B; - -export class C { -} - -//// [ExportAssignment8.js] -var C = (function () { - function C() { - } - return C; -})(); -exports.C = C; diff --git a/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedLocalVarsOfTheSameName.js b/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedLocalVarsOfTheSameName.js deleted file mode 100644 index 7712193af47..00000000000 --- a/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedLocalVarsOfTheSameName.js +++ /dev/null @@ -1,59 +0,0 @@ -//// [tests/cases/conformance/internalModules/DeclarationMerging/TwoInternalModulesThatMergeEachWithExportedLocalVarsOfTheSameName.ts] //// - -//// [part1.ts] -export module A { - export interface Point { - x: number; - y: number; - } - - export module Utils { - export function mirror(p: T) { - return { x: p.y, y: p.x }; - } - } - - export var Origin: Point = { x: 0, y: 0 }; -} - -//// [part2.ts] -export module A { - // collision with 'Origin' var in other part of merged module - export var Origin: Point = { x: 0, y: 0 }; - - export module Utils { - export class Plane { - constructor(public tl: Point, public br: Point) { } - } - } -} - - -//// [part1.js] -(function (A) { - (function (Utils) { - function mirror(p) { - return { x: p.y, y: p.x }; - } - Utils.mirror = mirror; - })(A.Utils || (A.Utils = {})); - var Utils = A.Utils; - A.Origin = { x: 0, y: 0 }; -})(exports.A || (exports.A = {})); -var A = exports.A; -//// [part2.js] -(function (A) { - A.Origin = { x: 0, y: 0 }; - (function (Utils) { - var Plane = (function () { - function Plane(tl, br) { - this.tl = tl; - this.br = br; - } - return Plane; - })(); - Utils.Plane = Plane; - })(A.Utils || (A.Utils = {})); - var Utils = A.Utils; -})(exports.A || (exports.A = {})); -var A = exports.A; diff --git a/tests/baselines/reference/ambientDeclarationsExternal.js b/tests/baselines/reference/ambientDeclarationsExternal.js deleted file mode 100644 index 09b5e00fa33..00000000000 --- a/tests/baselines/reference/ambientDeclarationsExternal.js +++ /dev/null @@ -1,31 +0,0 @@ -//// [tests/cases/conformance/ambient/ambientDeclarationsExternal.ts] //// - -//// [decls.ts] - -// Ambient external module with export assignment -declare module 'equ' { - var x; - export = x; -} - -declare module 'equ2' { - var x: number; -} - -// Ambient external import declaration referencing ambient external module using top level module name -//// [consumer.ts] -/// -import imp1 = require('equ'); - - -// Ambient external module members are always exported with or without export keyword when module lacks export assignment -import imp3 = require('equ2'); -var n = imp3.x; -var n: number; - - -//// [decls.js] -//// [consumer.js] -var imp3 = require('equ2'); -var n = imp3.x; -var n; diff --git a/tests/baselines/reference/circularReference.js b/tests/baselines/reference/circularReference.js deleted file mode 100644 index b9935b41a84..00000000000 --- a/tests/baselines/reference/circularReference.js +++ /dev/null @@ -1,66 +0,0 @@ -//// [tests/cases/conformance/externalModules/circularReference.ts] //// - -//// [foo1.ts] -import foo2 = require('./foo2'); -export module M1 { - export class C1 { - m1: foo2.M1.C1; - x: number; - constructor(){ - this.m1 = new foo2.M1.C1(); - this.m1.y = 10; // OK - this.m1.x = 20; // Error - } - } -} - -//// [foo2.ts] -import foo1 = require('./foo1'); -export module M1 { - export class C1 { - m1: foo1.M1.C1; - y: number - constructor(){ - this.m1 = new foo1.M1.C1(); - this.m1.y = 10; // Error - this.m1.x = 20; // OK - - var tmp = new M1.C1(); - tmp.y = 10; // OK - tmp.x = 20; // Error - } - } -} - - -//// [foo1.js] -var foo2 = require('./foo2'); -(function (M1) { - var C1 = (function () { - function C1() { - this.m1 = new foo2.M1.C1(); - this.m1.y = 10; - this.m1.x = 20; - } - return C1; - })(); - M1.C1 = C1; -})(exports.M1 || (exports.M1 = {})); -var M1 = exports.M1; -//// [foo2.js] -var foo1 = require('./foo1'); -(function (M1) { - var C1 = (function () { - function C1() { - this.m1 = new foo1.M1.C1(); - this.m1.y = 10; - this.m1.x = 20; - var tmp = new M1.C1(); - tmp.y = 10; - tmp.x = 20; - } - return C1; - })(); - M1.C1 = C1; -})(exports.M1 || (exports.M1 = {})); -var M1 = exports.M1; diff --git a/tests/baselines/reference/classMemberInitializerWithLamdaScoping3.js b/tests/baselines/reference/classMemberInitializerWithLamdaScoping3.js deleted file mode 100644 index 4f14159894e..00000000000 --- a/tests/baselines/reference/classMemberInitializerWithLamdaScoping3.js +++ /dev/null @@ -1,32 +0,0 @@ -//// [tests/cases/compiler/classMemberInitializerWithLamdaScoping3.ts] //// - -//// [classMemberInitializerWithLamdaScoping3_0.ts] -var field1: string; - -//// [classMemberInitializerWithLamdaScoping3_1.ts] -declare var console: { - log(msg?: any): void; -}; -export class Test1 { - constructor(private field1: string) { - } - messageHandler = () => { - console.log(field1); // But this should be error as the field1 will resolve to var field1 - // but since this code would be generated inside constructor, in generated js - // it would resolve to private field1 and thats not what user intended here. - }; -} - -//// [classMemberInitializerWithLamdaScoping3_0.js] -var field1; -//// [classMemberInitializerWithLamdaScoping3_1.js] -var Test1 = (function () { - function Test1(field1) { - this.field1 = field1; - this.messageHandler = function () { - console.log(field1); - }; - } - return Test1; -})(); -exports.Test1 = Test1; diff --git a/tests/baselines/reference/classMemberInitializerWithLamdaScoping4.js b/tests/baselines/reference/classMemberInitializerWithLamdaScoping4.js deleted file mode 100644 index 6451984deda..00000000000 --- a/tests/baselines/reference/classMemberInitializerWithLamdaScoping4.js +++ /dev/null @@ -1,30 +0,0 @@ -//// [tests/cases/compiler/classMemberInitializerWithLamdaScoping4.ts] //// - -//// [classMemberInitializerWithLamdaScoping3_0.ts] -export var field1: string; - -//// [classMemberInitializerWithLamdaScoping3_1.ts] -declare var console: { - log(msg?: any): void; -}; -export class Test1 { - constructor(private field1: string) { - } - messageHandler = () => { - console.log(field1); // Should be error that couldnt find symbol field1 - }; -} - -//// [classMemberInitializerWithLamdaScoping3_0.js] -exports.field1; -//// [classMemberInitializerWithLamdaScoping3_1.js] -var Test1 = (function () { - function Test1(field1) { - this.field1 = field1; - this.messageHandler = function () { - console.log(field1); - }; - } - return Test1; -})(); -exports.Test1 = Test1; diff --git a/tests/baselines/reference/duplicateExportAssignments.js b/tests/baselines/reference/duplicateExportAssignments.js deleted file mode 100644 index 84ad616d7cc..00000000000 --- a/tests/baselines/reference/duplicateExportAssignments.js +++ /dev/null @@ -1,80 +0,0 @@ -//// [tests/cases/conformance/externalModules/duplicateExportAssignments.ts] //// - -//// [foo1.ts] -var x = 10; -var y = 20; -export = x; -export = y; - -//// [foo2.ts] -var x = 10; -class y {}; -export = x; -export = y; - -//// [foo3.ts] -module x { - export var x = 10; -} -class y { - y: number; -} -export = x; -export = y; - -//// [foo4.ts] -export = x; -function x(){ - return 42; -} -function y(){ - return 42; -} -export = y; - -//// [foo5.ts] -var x = 5; -var y = "test"; -var z = {}; -export = x; -export = y; -export = z; - - -//// [foo1.js] -var x = 10; -var y = 20; -module.exports = x; -//// [foo2.js] -var x = 10; -var y = (function () { - function y() { - } - return y; -})(); -; -module.exports = x; -//// [foo3.js] -var x; -(function (x) { - x.x = 10; -})(x || (x = {})); -var y = (function () { - function y() { - } - return y; -})(); -module.exports = x; -//// [foo4.js] -function x() { - return 42; -} -function y() { - return 42; -} -module.exports = x; -//// [foo5.js] -var x = 5; -var y = "test"; -var z = {}; -module.exports = x; diff --git a/tests/baselines/reference/exportAssignImportedIdentifier.js b/tests/baselines/reference/exportAssignImportedIdentifier.js deleted file mode 100644 index 0367c270ddf..00000000000 --- a/tests/baselines/reference/exportAssignImportedIdentifier.js +++ /dev/null @@ -1,28 +0,0 @@ -//// [tests/cases/conformance/externalModules/exportAssignImportedIdentifier.ts] //// - -//// [foo1.ts] -export function x(){ - return true; -} - -//// [foo2.ts] -import foo1 = require('./foo1'); -var x = foo1.x; -export = x; - -//// [foo3.ts] -import foo2 = require('./foo2'); -var x = foo2(); // should be boolean - -//// [foo1.js] -function x() { - return true; -} -exports.x = x; -//// [foo2.js] -var foo1 = require('./foo1'); -var x = foo1.x; -module.exports = x; -//// [foo3.js] -var foo2 = require('./foo2'); -var x = foo2(); diff --git a/tests/baselines/reference/exportAssignNonIdentifier.errors.txt b/tests/baselines/reference/exportAssignNonIdentifier.errors.txt index 2e2ad680a03..7487d9547c1 100644 --- a/tests/baselines/reference/exportAssignNonIdentifier.errors.txt +++ b/tests/baselines/reference/exportAssignNonIdentifier.errors.txt @@ -1,10 +1,10 @@ ==== tests/cases/conformance/externalModules/foo1.ts (2 errors) ==== var x = 10; export = typeof x; // Error - ~~~~~~ -!!! Identifier expected. ~~~~~~~~ !!! Cannot compile external modules unless the '--module' flag is provided. + ~~~~~~ +!!! Identifier expected. ==== tests/cases/conformance/externalModules/foo2.ts (1 errors) ==== export = "sausages"; // Error diff --git a/tests/baselines/reference/exportAssignTypes.js b/tests/baselines/reference/exportAssignTypes.js deleted file mode 100644 index e898f798a7c..00000000000 --- a/tests/baselines/reference/exportAssignTypes.js +++ /dev/null @@ -1,93 +0,0 @@ -//// [tests/cases/conformance/externalModules/exportAssignTypes.ts] //// - -//// [expString.ts] -var x = "test"; -export = x; - -//// [expNumber.ts] -var x = 42; -export = x; - -//// [expBoolean.ts] -var x = true; -export = x; - -//// [expArray.ts] -var x = [1,2]; -export = x; - -//// [expObject.ts] -var x = { answer: 42, when: 1776}; -export = x; - -//// [expAny.ts] -var x; -export = x; - -//// [expGeneric.ts] -function x(a: T){ - return a; -} -export = x; - -//// [consumer.ts] -import iString = require('./expString'); -var v1: string = iString; - -import iNumber = require('./expNumber'); -var v2: number = iNumber; - -import iBoolean = require('./expBoolean'); -var v3: boolean = iBoolean; - -import iArray = require('./expArray'); -var v4: Array = iArray; - -import iObject = require('./expObject'); -var v5: Object = iObject; - -import iAny = require('./expAny'); -var v6 = iAny; - -import iGeneric = require('./expGeneric'); -var v7: {(p1: x): x} = iGeneric; - - -//// [expString.js] -var x = "test"; -module.exports = x; -//// [expNumber.js] -var x = 42; -module.exports = x; -//// [expBoolean.js] -var x = true; -module.exports = x; -//// [expArray.js] -var x = [1, 2]; -module.exports = x; -//// [expObject.js] -var x = { answer: 42, when: 1776 }; -module.exports = x; -//// [expAny.js] -var x; -module.exports = x; -//// [expGeneric.js] -function x(a) { - return a; -} -module.exports = x; -//// [consumer.js] -var iString = require('./expString'); -var v1 = iString; -var iNumber = require('./expNumber'); -var v2 = iNumber; -var iBoolean = require('./expBoolean'); -var v3 = iBoolean; -var iArray = require('./expArray'); -var v4 = iArray; -var iObject = require('./expObject'); -var v5 = iObject; -var iAny = require('./expAny'); -var v6 = iAny; -var iGeneric = require('./expGeneric'); -var v7 = iGeneric; diff --git a/tests/baselines/reference/exportDeclaredModule.js b/tests/baselines/reference/exportDeclaredModule.js deleted file mode 100644 index 7aa75288bff..00000000000 --- a/tests/baselines/reference/exportDeclaredModule.js +++ /dev/null @@ -1,19 +0,0 @@ -//// [tests/cases/conformance/externalModules/exportDeclaredModule.ts] //// - -//// [foo1.ts] - -declare module M1 { - export var a: string; - export function b(): number; -} -export = M1; - -//// [foo2.ts] -import foo1 = require('./foo1'); -var x: number = foo1.b(); - -//// [foo1.js] -module.exports = M1; -//// [foo2.js] -var foo1 = require('./foo1'); -var x = foo1.b(); diff --git a/tests/baselines/reference/exportNonVisibleType.js b/tests/baselines/reference/exportNonVisibleType.js deleted file mode 100644 index 101c356d582..00000000000 --- a/tests/baselines/reference/exportNonVisibleType.js +++ /dev/null @@ -1,54 +0,0 @@ -//// [tests/cases/conformance/externalModules/exportNonVisibleType.ts] //// - -//// [foo1.ts] -interface I1 { - a: string; - b: number; -} - -var x: I1 = {a: "test", b: 42}; -export = x; // Should fail, I1 not exported. - - -//// [foo2.ts] -interface I1 { - a: string; - b: number; -} - -class C1 { - m1: I1; -} - -export = C1; // Should fail, type I1 of visible member C1.m1 not exported. - -//// [foo3.ts] -interface I1 { - a: string; - b: number; -} - -class C1 { - private m1: I1; -} - -export = C1; // Should work, private type I1 of visible class C1 only used in private member m1. - - -//// [foo1.js] -var x = { a: "test", b: 42 }; -module.exports = x; -//// [foo2.js] -var C1 = (function () { - function C1() { - } - return C1; -})(); -module.exports = C1; -//// [foo3.js] -var C1 = (function () { - function C1() { - } - return C1; -})(); -module.exports = C1; diff --git a/tests/baselines/reference/externalModuleWithoutCompilerFlag1.js b/tests/baselines/reference/externalModuleWithoutCompilerFlag1.js deleted file mode 100644 index b5c939453e6..00000000000 --- a/tests/baselines/reference/externalModuleWithoutCompilerFlag1.js +++ /dev/null @@ -1,7 +0,0 @@ -//// [externalModuleWithoutCompilerFlag1.ts] - -// Not on line 0 because we want to verify the error is placed in the appropriate location. - export module M { -} - -//// [externalModuleWithoutCompilerFlag1.js] diff --git a/tests/baselines/reference/genericArrayExtenstions.js b/tests/baselines/reference/genericArrayExtenstions.js deleted file mode 100644 index 774e512d48f..00000000000 --- a/tests/baselines/reference/genericArrayExtenstions.js +++ /dev/null @@ -1,8 +0,0 @@ -//// [genericArrayExtenstions.ts] -export declare class ObservableArray implements Array { // MS.Entertainment.ObservableArray -concat(...items: U[]): T[]; -concat(...items: T[]): T[]; -} - - -//// [genericArrayExtenstions.js] diff --git a/tests/baselines/reference/importAliasAnExternalModuleInsideAnInternalModule.js b/tests/baselines/reference/importAliasAnExternalModuleInsideAnInternalModule.js deleted file mode 100644 index 2544a90ffbf..00000000000 --- a/tests/baselines/reference/importAliasAnExternalModuleInsideAnInternalModule.js +++ /dev/null @@ -1,30 +0,0 @@ -//// [tests/cases/compiler/importAliasAnExternalModuleInsideAnInternalModule.ts] //// - -//// [importAliasAnExternalModuleInsideAnInternalModule_file0.ts] -export module m { - export function foo() { } -} - -//// [importAliasAnExternalModuleInsideAnInternalModule_file1.ts] -import r = require('importAliasAnExternalModuleInsideAnInternalModule_file0'); -module m_private { - //import r2 = require('m'); // would be error - export import C = r; // no error - C.m.foo(); -} - - -//// [importAliasAnExternalModuleInsideAnInternalModule_file0.js] -(function (m) { - function foo() { - } - m.foo = foo; -})(exports.m || (exports.m = {})); -var m = exports.m; -//// [importAliasAnExternalModuleInsideAnInternalModule_file1.js] -var r = require('importAliasAnExternalModuleInsideAnInternalModule_file0'); -var m_private; -(function (m_private) { - m_private.C = r; - m_private.C.m.foo(); -})(m_private || (m_private = {})); diff --git a/tests/baselines/reference/importDeclRefereingExternalModuleWithNoResolve.js b/tests/baselines/reference/importDeclRefereingExternalModuleWithNoResolve.js deleted file mode 100644 index 34a662d6451..00000000000 --- a/tests/baselines/reference/importDeclRefereingExternalModuleWithNoResolve.js +++ /dev/null @@ -1,8 +0,0 @@ -//// [importDeclRefereingExternalModuleWithNoResolve.ts] -import b = require("externalModule"); -declare module "m1" { - import im2 = require("externalModule"); -} - - -//// [importDeclRefereingExternalModuleWithNoResolve.js] diff --git a/tests/baselines/reference/importDeclWithDeclareModifier.errors.txt b/tests/baselines/reference/importDeclWithDeclareModifier.errors.txt index da3a783c99c..972a1b9cc77 100644 --- a/tests/baselines/reference/importDeclWithDeclareModifier.errors.txt +++ b/tests/baselines/reference/importDeclWithDeclareModifier.errors.txt @@ -6,10 +6,10 @@ declare export import a = x.c; ~~~~~~~ !!! A 'declare' modifier cannot be used with an import declaration. - ~~~~~~ -!!! 'export' modifier must precede 'declare' modifier. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! Cannot compile external modules unless the '--module' flag is provided. + ~~~~~~ +!!! 'export' modifier must precede 'declare' modifier. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! Module 'x' has no exported member 'c'. var b: a; diff --git a/tests/baselines/reference/mergedModuleDeclarationCodeGen.js b/tests/baselines/reference/mergedModuleDeclarationCodeGen.js deleted file mode 100644 index c560f7ee329..00000000000 --- a/tests/baselines/reference/mergedModuleDeclarationCodeGen.js +++ /dev/null @@ -1,42 +0,0 @@ -//// [mergedModuleDeclarationCodeGen.ts] -export module X { - export module Y { - class A { - constructor(Y: any) { - new B(); - } - } - } -} -export module X { - export module Y { - export class B { - } - } -} - -//// [mergedModuleDeclarationCodeGen.js] -(function (X) { - (function (Y) { - var A = (function () { - function A(Y) { - new Y.B(); - } - return A; - })(); - })(X.Y || (X.Y = {})); - var Y = X.Y; -})(exports.X || (exports.X = {})); -var X = exports.X; -(function (X) { - (function (Y) { - var B = (function () { - function B() { - } - return B; - })(); - Y.B = B; - })(X.Y || (X.Y = {})); - var Y = X.Y; -})(exports.X || (exports.X = {})); -var X = exports.X; diff --git a/tests/baselines/reference/moduleScoping.js b/tests/baselines/reference/moduleScoping.js deleted file mode 100644 index 49431acaece..00000000000 --- a/tests/baselines/reference/moduleScoping.js +++ /dev/null @@ -1,40 +0,0 @@ -//// [tests/cases/conformance/externalModules/moduleScoping.ts] //// - -//// [file1.ts] -var v1 = "sausages"; // Global scope - -//// [file2.ts] -var v2 = 42; // Global scope -var v4 = () => 5; - -//// [file3.ts] -export var v3 = true; -var v2 = [1,2,3]; // Module scope. Should not appear in global scope - -//// [file4.ts] -import file3 = require('./file3'); -var t1 = v1; -var t2 = v2; -var t3 = file3.v3; -var v4 = {a: true, b: NaN}; // Should shadow global v2 in this module - -//// [file5.ts] -var x = v2; // Should be global v2 of type number again - - -//// [file1.js] -var v1 = "sausages"; -//// [file2.js] -var v2 = 42; -var v4 = function () { return 5; }; -//// [file3.js] -exports.v3 = true; -var v2 = [1, 2, 3]; -//// [file4.js] -var file3 = require('./file3'); -var t1 = v1; -var t2 = v2; -var t3 = file3.v3; -var v4 = { a: true, b: NaN }; -//// [file5.js] -var x = v2; diff --git a/tests/baselines/reference/multiImportExport.js b/tests/baselines/reference/multiImportExport.js deleted file mode 100644 index f462ae3dff7..00000000000 --- a/tests/baselines/reference/multiImportExport.js +++ /dev/null @@ -1,47 +0,0 @@ -//// [tests/cases/compiler/multiImportExport.ts] //// - -//// [consumer.ts] -import Drawing = require('./Drawing'); -var addr = new Drawing.Math.Adder(); - -//// [Drawing.ts] -export import Math = require('Math/Math') - -//// [Math.ts] -import Adder = require('Math/Adder'); - -var Math = { - Adder:Adder -}; - -export = Math - -//// [Adder.ts] -class Adder { - add(a: number, b: number) { - - } -} - -export = Adder; - -//// [Adder.js] -var Adder = (function () { - function Adder() { - } - Adder.prototype.add = function (a, b) { - }; - return Adder; -})(); -module.exports = Adder; -//// [Math.js] -var Adder = require('Math/Adder'); -var Math = { - Adder: Adder -}; -module.exports = Math; -//// [Drawing.js] -exports.Math = require('Math/Math'); -//// [consumer.js] -var Drawing = require('./Drawing'); -var addr = new Drawing.Math.Adder(); diff --git a/tests/baselines/reference/parser0_004152.errors.txt b/tests/baselines/reference/parser0_004152.errors.txt index 07c7126d8b5..794cb66d0d1 100644 --- a/tests/baselines/reference/parser0_004152.errors.txt +++ b/tests/baselines/reference/parser0_004152.errors.txt @@ -2,6 +2,7 @@ export class Game { ~~~~~~~~~~~~~~~~~~~ private position = new DisplayPosition([), 3, 3, 3, 3, 3, 0, 3, 3, 3, 3, 3, 3, 0], NoMove, 0); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~ !!! Expression or comma expected. ~ @@ -40,7 +41,6 @@ !!! ';' expected. ~ !!! Unexpected token. A constructor, method, accessor, or property was expected. - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~ !!! Cannot find name 'DisplayPosition'. ~ diff --git a/tests/baselines/reference/parser509546.js b/tests/baselines/reference/parser509546.js deleted file mode 100644 index 5524a4d606f..00000000000 --- a/tests/baselines/reference/parser509546.js +++ /dev/null @@ -1,13 +0,0 @@ -//// [parser509546.ts] -export class Logger { - public -} - - -//// [parser509546.js] -var Logger = (function () { - function Logger() { - } - return Logger; -})(); -exports.Logger = Logger; diff --git a/tests/baselines/reference/parser509546_1.js b/tests/baselines/reference/parser509546_1.js deleted file mode 100644 index d0e32feb1ca..00000000000 --- a/tests/baselines/reference/parser509546_1.js +++ /dev/null @@ -1,13 +0,0 @@ -//// [parser509546_1.ts] -export class Logger { - public -} - - -//// [parser509546_1.js] -var Logger = (function () { - function Logger() { - } - return Logger; -})(); -exports.Logger = Logger; diff --git a/tests/baselines/reference/parser509546_2.js b/tests/baselines/reference/parser509546_2.js deleted file mode 100644 index 976bbd1e471..00000000000 --- a/tests/baselines/reference/parser509546_2.js +++ /dev/null @@ -1,16 +0,0 @@ -//// [parser509546_2.ts] -"use strict"; - -export class Logger { - public -} - - -//// [parser509546_2.js] -"use strict"; -var Logger = (function () { - function Logger() { - } - return Logger; -})(); -exports.Logger = Logger; diff --git a/tests/baselines/reference/parser618973.errors.txt b/tests/baselines/reference/parser618973.errors.txt index 12608abff52..dc14aa9a9d4 100644 --- a/tests/baselines/reference/parser618973.errors.txt +++ b/tests/baselines/reference/parser618973.errors.txt @@ -1,8 +1,8 @@ ==== tests/cases/conformance/parser/ecmascript5/RegressionTests/parser618973.ts (2 errors) ==== export export class Foo { + ~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~ !!! 'export' modifier already seen. - ~~~~~~~~~~~~~~~~~~~~~~~~~ public Bar() { ~~~~~~~~~~~~~~~~ } diff --git a/tests/baselines/reference/parserArgumentList1.js b/tests/baselines/reference/parserArgumentList1.js deleted file mode 100644 index d33e8931d18..00000000000 --- a/tests/baselines/reference/parserArgumentList1.js +++ /dev/null @@ -1,14 +0,0 @@ -//// [parserArgumentList1.ts] -export function removeClass (node:HTMLElement, className:string) { - node.className = node.className.replace(_classNameRegexp(className), function (everything, leftDelimiter, name, rightDelimiter) { - return leftDelimiter.length + rightDelimiter.length === 2 ? ' ' : ''; - }); -} - -//// [parserArgumentList1.js] -function removeClass(node, className) { - node.className = node.className.replace(_classNameRegexp(className), function (everything, leftDelimiter, name, rightDelimiter) { - return leftDelimiter.length + rightDelimiter.length === 2 ? ' ' : ''; - }); -} -exports.removeClass = removeClass; diff --git a/tests/baselines/reference/parserClass1.js b/tests/baselines/reference/parserClass1.js deleted file mode 100644 index 1245da3363f..00000000000 --- a/tests/baselines/reference/parserClass1.js +++ /dev/null @@ -1,35 +0,0 @@ -//// [parserClass1.ts] - export class NullLogger implements ILogger { - public information(): boolean { return false; } - public debug(): boolean { return false; } - public warning(): boolean { return false; } - public error(): boolean { return false; } - public fatal(): boolean { return false; } - public log(s: string): void { - } - } - -//// [parserClass1.js] -var NullLogger = (function () { - function NullLogger() { - } - NullLogger.prototype.information = function () { - return false; - }; - NullLogger.prototype.debug = function () { - return false; - }; - NullLogger.prototype.warning = function () { - return false; - }; - NullLogger.prototype.error = function () { - return false; - }; - NullLogger.prototype.fatal = function () { - return false; - }; - NullLogger.prototype.log = function (s) { - }; - return NullLogger; -})(); -exports.NullLogger = NullLogger; diff --git a/tests/baselines/reference/parserClass2.js b/tests/baselines/reference/parserClass2.js deleted file mode 100644 index b3816ea6ebb..00000000000 --- a/tests/baselines/reference/parserClass2.js +++ /dev/null @@ -1,18 +0,0 @@ -//// [parserClass2.ts] - - - export class LoggerAdapter implements ILogger { - constructor (public logger: ILogger) { - this._information = this.logger.information(); - } - } - -//// [parserClass2.js] -var LoggerAdapter = (function () { - function LoggerAdapter(logger) { - this.logger = logger; - this._information = this.logger.information(); - } - return LoggerAdapter; -})(); -exports.LoggerAdapter = LoggerAdapter; diff --git a/tests/baselines/reference/parserEnum1.js b/tests/baselines/reference/parserEnum1.js deleted file mode 100644 index 8bd9d128233..00000000000 --- a/tests/baselines/reference/parserEnum1.js +++ /dev/null @@ -1,18 +0,0 @@ -//// [parserEnum1.ts] - - - export enum SignatureFlags { - None = 0, - IsIndexer = 1, - IsStringIndexer = 1 << 1, - IsNumberIndexer = 1 << 2, - } - -//// [parserEnum1.js] -(function (SignatureFlags) { - SignatureFlags[SignatureFlags["None"] = 0] = "None"; - SignatureFlags[SignatureFlags["IsIndexer"] = 1] = "IsIndexer"; - SignatureFlags[SignatureFlags["IsStringIndexer"] = 1 << 1] = "IsStringIndexer"; - SignatureFlags[SignatureFlags["IsNumberIndexer"] = 1 << 2] = "IsNumberIndexer"; -})(exports.SignatureFlags || (exports.SignatureFlags = {})); -var SignatureFlags = exports.SignatureFlags; diff --git a/tests/baselines/reference/parserEnum2.js b/tests/baselines/reference/parserEnum2.js deleted file mode 100644 index 22946153449..00000000000 --- a/tests/baselines/reference/parserEnum2.js +++ /dev/null @@ -1,18 +0,0 @@ -//// [parserEnum2.ts] - - - export enum SignatureFlags { - None = 0, - IsIndexer = 1, - IsStringIndexer = 1 << 1, - IsNumberIndexer = 1 << 2 - } - -//// [parserEnum2.js] -(function (SignatureFlags) { - SignatureFlags[SignatureFlags["None"] = 0] = "None"; - SignatureFlags[SignatureFlags["IsIndexer"] = 1] = "IsIndexer"; - SignatureFlags[SignatureFlags["IsStringIndexer"] = 1 << 1] = "IsStringIndexer"; - SignatureFlags[SignatureFlags["IsNumberIndexer"] = 1 << 2] = "IsNumberIndexer"; -})(exports.SignatureFlags || (exports.SignatureFlags = {})); -var SignatureFlags = exports.SignatureFlags; diff --git a/tests/baselines/reference/parserEnum3.js b/tests/baselines/reference/parserEnum3.js deleted file mode 100644 index bbfb2039314..00000000000 --- a/tests/baselines/reference/parserEnum3.js +++ /dev/null @@ -1,10 +0,0 @@ -//// [parserEnum3.ts] - - - export enum SignatureFlags { - } - -//// [parserEnum3.js] -(function (SignatureFlags) { -})(exports.SignatureFlags || (exports.SignatureFlags = {})); -var SignatureFlags = exports.SignatureFlags; diff --git a/tests/baselines/reference/parserEnum4.errors.txt b/tests/baselines/reference/parserEnum4.errors.txt index a6d8387ebc2..f0be68c95ff 100644 --- a/tests/baselines/reference/parserEnum4.errors.txt +++ b/tests/baselines/reference/parserEnum4.errors.txt @@ -4,9 +4,9 @@ export enum SignatureFlags { ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ , + ~~~~~~~~~ ~ !!! Enum member expected. - ~~~~~~~~~ } ~~~~~ !!! Cannot compile external modules unless the '--module' flag is provided. \ No newline at end of file diff --git a/tests/baselines/reference/parserExportAssignment1.js b/tests/baselines/reference/parserExportAssignment1.js deleted file mode 100644 index 5f3c0e1513f..00000000000 --- a/tests/baselines/reference/parserExportAssignment1.js +++ /dev/null @@ -1,4 +0,0 @@ -//// [parserExportAssignment1.ts] -export = foo - -//// [parserExportAssignment1.js] diff --git a/tests/baselines/reference/parserExportAssignment2.js b/tests/baselines/reference/parserExportAssignment2.js deleted file mode 100644 index aaa12cea179..00000000000 --- a/tests/baselines/reference/parserExportAssignment2.js +++ /dev/null @@ -1,4 +0,0 @@ -//// [parserExportAssignment2.ts] -export = foo; - -//// [parserExportAssignment2.js] diff --git a/tests/baselines/reference/parserExportAssignment3.errors.txt b/tests/baselines/reference/parserExportAssignment3.errors.txt index 21b5563b788..5126744521e 100644 --- a/tests/baselines/reference/parserExportAssignment3.errors.txt +++ b/tests/baselines/reference/parserExportAssignment3.errors.txt @@ -1,6 +1,6 @@ ==== tests/cases/conformance/parser/ecmascript5/ExportAssignments/parserExportAssignment3.ts (2 errors) ==== export = - -!!! Identifier expected. ~~~~~~~~ -!!! Cannot compile external modules unless the '--module' flag is provided. \ No newline at end of file +!!! Cannot compile external modules unless the '--module' flag is provided. + +!!! Identifier expected. \ No newline at end of file diff --git a/tests/baselines/reference/parserExportAssignment4.errors.txt b/tests/baselines/reference/parserExportAssignment4.errors.txt index 584d8cb4b75..d8d7c27ff61 100644 --- a/tests/baselines/reference/parserExportAssignment4.errors.txt +++ b/tests/baselines/reference/parserExportAssignment4.errors.txt @@ -1,6 +1,6 @@ ==== tests/cases/conformance/parser/ecmascript5/ExportAssignments/parserExportAssignment4.ts (2 errors) ==== export = ; - ~ -!!! Identifier expected. ~~~~~~~~~~ -!!! Cannot compile external modules unless the '--module' flag is provided. \ No newline at end of file +!!! Cannot compile external modules unless the '--module' flag is provided. + ~ +!!! Identifier expected. \ No newline at end of file diff --git a/tests/baselines/reference/parserExportAssignment7.js b/tests/baselines/reference/parserExportAssignment7.js deleted file mode 100644 index 52f9848c243..00000000000 --- a/tests/baselines/reference/parserExportAssignment7.js +++ /dev/null @@ -1,13 +0,0 @@ -//// [parserExportAssignment7.ts] -export class C { -} - -export = B; - -//// [parserExportAssignment7.js] -var C = (function () { - function C() { - } - return C; -})(); -exports.C = C; diff --git a/tests/baselines/reference/parserExportAssignment8.js b/tests/baselines/reference/parserExportAssignment8.js deleted file mode 100644 index 3c5b851284e..00000000000 --- a/tests/baselines/reference/parserExportAssignment8.js +++ /dev/null @@ -1,13 +0,0 @@ -//// [parserExportAssignment8.ts] -export = B; - -export class C { -} - -//// [parserExportAssignment8.js] -var C = (function () { - function C() { - } - return C; -})(); -exports.C = C; diff --git a/tests/baselines/reference/parserInterfaceDeclaration6.errors.txt b/tests/baselines/reference/parserInterfaceDeclaration6.errors.txt index 029f5be5f94..fd1cfa3522a 100644 --- a/tests/baselines/reference/parserInterfaceDeclaration6.errors.txt +++ b/tests/baselines/reference/parserInterfaceDeclaration6.errors.txt @@ -1,8 +1,8 @@ ==== tests/cases/conformance/parser/ecmascript5/InterfaceDeclarations/parserInterfaceDeclaration6.ts (2 errors) ==== export export interface I { + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~ !!! 'export' modifier already seen. - ~~~~~~~~~~~~~~~~~~~~~~~~~~~ } ~ !!! Cannot compile external modules unless the '--module' flag is provided. \ No newline at end of file diff --git a/tests/baselines/reference/parserInterfaceDeclaration7.js b/tests/baselines/reference/parserInterfaceDeclaration7.js deleted file mode 100644 index 40998c119cf..00000000000 --- a/tests/baselines/reference/parserInterfaceDeclaration7.js +++ /dev/null @@ -1,5 +0,0 @@ -//// [parserInterfaceDeclaration7.ts] -export interface I { -} - -//// [parserInterfaceDeclaration7.js] diff --git a/tests/baselines/reference/parserModule1.js b/tests/baselines/reference/parserModule1.js deleted file mode 100644 index 6005b7fd106..00000000000 --- a/tests/baselines/reference/parserModule1.js +++ /dev/null @@ -1,60 +0,0 @@ -//// [parserModule1.ts] - export module CompilerDiagnostics { - export var debug = false; - export interface IDiagnosticWriter { - Alert(output: string): void; - } - - export var diagnosticWriter: IDiagnosticWriter = null; - - export var analysisPass: number = 0; - - export function Alert(output: string) { - if (diagnosticWriter) { - diagnosticWriter.Alert(output); - } - } - - export function debugPrint(s: string) { - if (debug) { - Alert(s); - } - } - - export function assert(condition: boolean, s: string) { - if (debug) { - if (!condition) { - Alert(s); - } - } - } - - } - -//// [parserModule1.js] -(function (CompilerDiagnostics) { - CompilerDiagnostics.debug = false; - CompilerDiagnostics.diagnosticWriter = null; - CompilerDiagnostics.analysisPass = 0; - function Alert(output) { - if (CompilerDiagnostics.diagnosticWriter) { - CompilerDiagnostics.diagnosticWriter.Alert(output); - } - } - CompilerDiagnostics.Alert = Alert; - function debugPrint(s) { - if (CompilerDiagnostics.debug) { - Alert(s); - } - } - CompilerDiagnostics.debugPrint = debugPrint; - function assert(condition, s) { - if (CompilerDiagnostics.debug) { - if (!condition) { - Alert(s); - } - } - } - CompilerDiagnostics.assert = assert; -})(exports.CompilerDiagnostics || (exports.CompilerDiagnostics = {})); -var CompilerDiagnostics = exports.CompilerDiagnostics; diff --git a/tests/baselines/reference/privacyCheckTypeOfFunction.js b/tests/baselines/reference/privacyCheckTypeOfFunction.js deleted file mode 100644 index 757416c691b..00000000000 --- a/tests/baselines/reference/privacyCheckTypeOfFunction.js +++ /dev/null @@ -1,12 +0,0 @@ -//// [privacyCheckTypeOfFunction.ts] -function foo() { -} -export var x: typeof foo; -export var b = foo; - - -//// [privacyCheckTypeOfFunction.js] -function foo() { -} -exports.x; -exports.b = foo; diff --git a/tests/baselines/reference/privacyTypeParameterOfFunction.js b/tests/baselines/reference/privacyTypeParameterOfFunction.js deleted file mode 100644 index e3c45eea6a0..00000000000 --- a/tests/baselines/reference/privacyTypeParameterOfFunction.js +++ /dev/null @@ -1,242 +0,0 @@ -//// [privacyTypeParameterOfFunction.ts] -class privateClass { -} - -export class publicClass { -} - -export interface publicInterfaceWithPrivateTypeParameters { - // TypeParameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_type_1 - new (): privateClass; - - // TypeParameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_type_1 - (): privateClass; - - // TypeParameter_0_of_method_from_exported_interface_has_or_is_using_private_type_1 - myMethod(): privateClass; -} - -export interface publicInterfaceWithPublicTypeParameters { - new (): publicClass; - (): publicClass; - myMethod(): publicClass; -} - -interface privateInterfaceWithPrivateTypeParameters { - new (): privateClass; - (): privateClass; - myMethod(): privateClass; -} - -interface privateInterfaceWithPublicTypeParameters { - new (): publicClass; - (): publicClass; - myMethod(): publicClass; -} - -export class publicClassWithWithPrivateTypeParameters { - // TypeParameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_type_1 - static myPublicStaticMethod() { - } - private static myPrivateStaticMethod() { // No error - } - // TypeParameter_0_of_public_method_from_exported_class_has_or_is_using_private_type_1 - myPublicMethod() { - } - private myPrivateMethod() { // No error - } -} - -export class publicClassWithWithPublicTypeParameters { - static myPublicStaticMethod() { - } - private static myPrivateStaticMethod() { - } - myPublicMethod() { - } - private myPrivateMethod() { - } -} - -class privateClassWithWithPrivateTypeParameters { - static myPublicStaticMethod() { - } - private static myPrivateStaticMethod() { // No error - } - myPublicMethod() { - } - private myPrivateMethod() { // No error - } -} - -class privateClassWithWithPublicTypeParameters { - static myPublicStaticMethod() { - } - private static myPrivateStaticMethod() { - } - myPublicMethod() { - } - private myPrivateMethod() { - } -} - -// TypeParameter_0_of_exported_function_has_or_is_using_private_type_1 -export function publicFunctionWithPrivateTypeParameters() { -} - -export function publicFunctionWithPublicTypeParameters() { -} - -function privateFunctionWithPrivateTypeParameters() { -} - -function privateFunctionWithPublicTypeParameters() { -} - -export interface publicInterfaceWithPublicTypeParametersWithoutExtends { - new (): publicClass; - (): publicClass; - myMethod(): publicClass; -} - -interface privateInterfaceWithPublicTypeParametersWithoutExtends { - new (): publicClass; - (): publicClass; - myMethod(): publicClass; -} - -export class publicClassWithWithPublicTypeParametersWithoutExtends { - static myPublicStaticMethod() { - } - private static myPrivateStaticMethod() { - } - myPublicMethod() { - } - private myPrivateMethod() { - } -} -class privateClassWithWithPublicTypeParametersWithoutExtends { - static myPublicStaticMethod() { - } - private static myPrivateStaticMethod() { - } - myPublicMethod() { - } - private myPrivateMethod() { - } -} - -export function publicFunctionWithPublicTypeParametersWithoutExtends() { -} - -function privateFunctionWithPublicTypeParametersWithoutExtends() { -} - -//// [privacyTypeParameterOfFunction.js] -var privateClass = (function () { - function privateClass() { - } - return privateClass; -})(); -var publicClass = (function () { - function publicClass() { - } - return publicClass; -})(); -exports.publicClass = publicClass; -var publicClassWithWithPrivateTypeParameters = (function () { - function publicClassWithWithPrivateTypeParameters() { - } - publicClassWithWithPrivateTypeParameters.myPublicStaticMethod = function () { - }; - publicClassWithWithPrivateTypeParameters.myPrivateStaticMethod = function () { - }; - publicClassWithWithPrivateTypeParameters.prototype.myPublicMethod = function () { - }; - publicClassWithWithPrivateTypeParameters.prototype.myPrivateMethod = function () { - }; - return publicClassWithWithPrivateTypeParameters; -})(); -exports.publicClassWithWithPrivateTypeParameters = publicClassWithWithPrivateTypeParameters; -var publicClassWithWithPublicTypeParameters = (function () { - function publicClassWithWithPublicTypeParameters() { - } - publicClassWithWithPublicTypeParameters.myPublicStaticMethod = function () { - }; - publicClassWithWithPublicTypeParameters.myPrivateStaticMethod = function () { - }; - publicClassWithWithPublicTypeParameters.prototype.myPublicMethod = function () { - }; - publicClassWithWithPublicTypeParameters.prototype.myPrivateMethod = function () { - }; - return publicClassWithWithPublicTypeParameters; -})(); -exports.publicClassWithWithPublicTypeParameters = publicClassWithWithPublicTypeParameters; -var privateClassWithWithPrivateTypeParameters = (function () { - function privateClassWithWithPrivateTypeParameters() { - } - privateClassWithWithPrivateTypeParameters.myPublicStaticMethod = function () { - }; - privateClassWithWithPrivateTypeParameters.myPrivateStaticMethod = function () { - }; - privateClassWithWithPrivateTypeParameters.prototype.myPublicMethod = function () { - }; - privateClassWithWithPrivateTypeParameters.prototype.myPrivateMethod = function () { - }; - return privateClassWithWithPrivateTypeParameters; -})(); -var privateClassWithWithPublicTypeParameters = (function () { - function privateClassWithWithPublicTypeParameters() { - } - privateClassWithWithPublicTypeParameters.myPublicStaticMethod = function () { - }; - privateClassWithWithPublicTypeParameters.myPrivateStaticMethod = function () { - }; - privateClassWithWithPublicTypeParameters.prototype.myPublicMethod = function () { - }; - privateClassWithWithPublicTypeParameters.prototype.myPrivateMethod = function () { - }; - return privateClassWithWithPublicTypeParameters; -})(); -function publicFunctionWithPrivateTypeParameters() { -} -exports.publicFunctionWithPrivateTypeParameters = publicFunctionWithPrivateTypeParameters; -function publicFunctionWithPublicTypeParameters() { -} -exports.publicFunctionWithPublicTypeParameters = publicFunctionWithPublicTypeParameters; -function privateFunctionWithPrivateTypeParameters() { -} -function privateFunctionWithPublicTypeParameters() { -} -var publicClassWithWithPublicTypeParametersWithoutExtends = (function () { - function publicClassWithWithPublicTypeParametersWithoutExtends() { - } - publicClassWithWithPublicTypeParametersWithoutExtends.myPublicStaticMethod = function () { - }; - publicClassWithWithPublicTypeParametersWithoutExtends.myPrivateStaticMethod = function () { - }; - publicClassWithWithPublicTypeParametersWithoutExtends.prototype.myPublicMethod = function () { - }; - publicClassWithWithPublicTypeParametersWithoutExtends.prototype.myPrivateMethod = function () { - }; - return publicClassWithWithPublicTypeParametersWithoutExtends; -})(); -exports.publicClassWithWithPublicTypeParametersWithoutExtends = publicClassWithWithPublicTypeParametersWithoutExtends; -var privateClassWithWithPublicTypeParametersWithoutExtends = (function () { - function privateClassWithWithPublicTypeParametersWithoutExtends() { - } - privateClassWithWithPublicTypeParametersWithoutExtends.myPublicStaticMethod = function () { - }; - privateClassWithWithPublicTypeParametersWithoutExtends.myPrivateStaticMethod = function () { - }; - privateClassWithWithPublicTypeParametersWithoutExtends.prototype.myPublicMethod = function () { - }; - privateClassWithWithPublicTypeParametersWithoutExtends.prototype.myPrivateMethod = function () { - }; - return privateClassWithWithPublicTypeParametersWithoutExtends; -})(); -function publicFunctionWithPublicTypeParametersWithoutExtends() { -} -exports.publicFunctionWithPublicTypeParametersWithoutExtends = publicFunctionWithPublicTypeParametersWithoutExtends; -function privateFunctionWithPublicTypeParametersWithoutExtends() { -} diff --git a/tests/baselines/reference/privacyTypeParametersOfClass.js b/tests/baselines/reference/privacyTypeParametersOfClass.js deleted file mode 100644 index d2e45557b2d..00000000000 --- a/tests/baselines/reference/privacyTypeParametersOfClass.js +++ /dev/null @@ -1,108 +0,0 @@ -//// [privacyTypeParametersOfClass.ts] -class privateClass { -} - -export class publicClass { -} - -// TypeParameter_0_of_exported_class_1_has_or_is_using_private_type_2 -export class publicClassWithPrivateTypeParameters { - myMethod(val: T): T { // Error - return val; - } -} - -export class publicClassWithPublicTypeParameters { - myMethod(val: T): T { // No Error - return val; - } -} - -class privateClassWithPrivateTypeParameters { - myMethod(val: T): T { // No Error - return val; - } -} - -class privateClassWithPublicTypeParameters { - myMethod(val: T): T { // No Error - return val; - } -} - -export class publicClassWithPublicTypeParametersWithoutExtends { - myMethod(val: T): T { // No Error - return val; - } -} - -class privateClassWithPublicTypeParametersWithoutExtends { - myMethod(val: T): T { // No Error - return val; - } -} - - -//// [privacyTypeParametersOfClass.js] -var privateClass = (function () { - function privateClass() { - } - return privateClass; -})(); -var publicClass = (function () { - function publicClass() { - } - return publicClass; -})(); -exports.publicClass = publicClass; -var publicClassWithPrivateTypeParameters = (function () { - function publicClassWithPrivateTypeParameters() { - } - publicClassWithPrivateTypeParameters.prototype.myMethod = function (val) { - return val; - }; - return publicClassWithPrivateTypeParameters; -})(); -exports.publicClassWithPrivateTypeParameters = publicClassWithPrivateTypeParameters; -var publicClassWithPublicTypeParameters = (function () { - function publicClassWithPublicTypeParameters() { - } - publicClassWithPublicTypeParameters.prototype.myMethod = function (val) { - return val; - }; - return publicClassWithPublicTypeParameters; -})(); -exports.publicClassWithPublicTypeParameters = publicClassWithPublicTypeParameters; -var privateClassWithPrivateTypeParameters = (function () { - function privateClassWithPrivateTypeParameters() { - } - privateClassWithPrivateTypeParameters.prototype.myMethod = function (val) { - return val; - }; - return privateClassWithPrivateTypeParameters; -})(); -var privateClassWithPublicTypeParameters = (function () { - function privateClassWithPublicTypeParameters() { - } - privateClassWithPublicTypeParameters.prototype.myMethod = function (val) { - return val; - }; - return privateClassWithPublicTypeParameters; -})(); -var publicClassWithPublicTypeParametersWithoutExtends = (function () { - function publicClassWithPublicTypeParametersWithoutExtends() { - } - publicClassWithPublicTypeParametersWithoutExtends.prototype.myMethod = function (val) { - return val; - }; - return publicClassWithPublicTypeParametersWithoutExtends; -})(); -exports.publicClassWithPublicTypeParametersWithoutExtends = publicClassWithPublicTypeParametersWithoutExtends; -var privateClassWithPublicTypeParametersWithoutExtends = (function () { - function privateClassWithPublicTypeParametersWithoutExtends() { - } - privateClassWithPublicTypeParametersWithoutExtends.prototype.myMethod = function (val) { - return val; - }; - return privateClassWithPublicTypeParametersWithoutExtends; -})(); diff --git a/tests/baselines/reference/privacyTypeParametersOfInterface.js b/tests/baselines/reference/privacyTypeParametersOfInterface.js deleted file mode 100644 index 02e63ce7098..00000000000 --- a/tests/baselines/reference/privacyTypeParametersOfInterface.js +++ /dev/null @@ -1,83 +0,0 @@ -//// [privacyTypeParametersOfInterface.ts] -class privateClass { -} - -export class publicClass { -} - -class privateClassT { -} - -export class publicClassT { -} - -// TypeParameter_0_of_exported_interface_1_has_or_is_using_private_type_2 -export interface publicInterfaceWithPrivateTypeParameters { - myMethod(val: T): T; // Error - myMethod0(): publicClassT; // error - myMethod1(): privateClassT; // error - myMethod2(): privateClassT; // error - myMethod3(): publicClassT; //error - myMethod4(): publicClassT; // no error -} - -export interface publicInterfaceWithPublicTypeParameters { - myMethod(val: T): T; // No Error - myMethod0(): publicClassT; // No error - myMethod1(): privateClassT; // error - myMethod2(): privateClassT; // error - myMethod3(): publicClassT; //error - myMethod4(): publicClassT; // no error -} - -interface privateInterfaceWithPrivateTypeParameters { - myMethod(val: T): T; // No Error - myMethod0(): publicClassT; // No error - myMethod1(): privateClassT; // No error - myMethod2(): privateClassT; // No error - myMethod3(): publicClassT; //No error - myMethod4(): publicClassT; // no error -} - -interface privateInterfaceWithPublicTypeParameters { - myMethod(val: T): T; // No Error - myMethod0(): publicClassT; // No error - myMethod1(): privateClassT; // No error - myMethod2(): privateClassT; // No error - myMethod3(): publicClassT; //No error - myMethod4(): publicClassT; // no error -} - -export interface publicInterfaceWithPublicTypeParametersWithoutExtends { - myMethod(val: T): T; // No Error - myMethod0(): publicClassT; // No error -} - -interface privateInterfaceWithPublicTypeParametersWithoutExtends { - myMethod(val: T): T; // No Error - myMethod0(): publicClassT; // No error -} - -//// [privacyTypeParametersOfInterface.js] -var privateClass = (function () { - function privateClass() { - } - return privateClass; -})(); -var publicClass = (function () { - function publicClass() { - } - return publicClass; -})(); -exports.publicClass = publicClass; -var privateClassT = (function () { - function privateClassT() { - } - return privateClassT; -})(); -var publicClassT = (function () { - function publicClassT() { - } - return publicClassT; -})(); -exports.publicClassT = publicClassT; diff --git a/tests/baselines/reference/relativePathToDeclarationFile.js b/tests/baselines/reference/relativePathToDeclarationFile.js deleted file mode 100644 index e50db2be926..00000000000 --- a/tests/baselines/reference/relativePathToDeclarationFile.js +++ /dev/null @@ -1,35 +0,0 @@ -//// [tests/cases/conformance/externalModules/relativePathToDeclarationFile.ts] //// - -//// [foo.d.ts] -export declare module M2 { - export var x: boolean; -} - -//// [other.d.ts] -export declare module M2 { - export var x: string; -} - -//// [relMod.d.ts] -declare class Test { - constructor(x: number); -} -export = Test; - -//// [file1.ts] -import foo = require('foo'); -import other = require('./other'); -import relMod = require('./sub/relMod'); - -if(foo.M2.x){ - var x = new relMod(other.M2.x.charCodeAt(0)); -} - - -//// [file1.js] -var foo = require('foo'); -var other = require('./other'); -var relMod = require('./sub/relMod'); -if (foo.M2.x) { - var x = new relMod(other.M2.x.charCodeAt(0)); -} diff --git a/tests/baselines/reference/scannerClass2.js b/tests/baselines/reference/scannerClass2.js deleted file mode 100644 index 88dd9919f9c..00000000000 --- a/tests/baselines/reference/scannerClass2.js +++ /dev/null @@ -1,18 +0,0 @@ -//// [scannerClass2.ts] - - - export class LoggerAdapter implements ILogger { - constructor (public logger: ILogger) { - this._information = this.logger.information(); - } - } - -//// [scannerClass2.js] -var LoggerAdapter = (function () { - function LoggerAdapter(logger) { - this.logger = logger; - this._information = this.logger.information(); - } - return LoggerAdapter; -})(); -exports.LoggerAdapter = LoggerAdapter; diff --git a/tests/baselines/reference/scannerEnum1.js b/tests/baselines/reference/scannerEnum1.js deleted file mode 100644 index b503de2c2b0..00000000000 --- a/tests/baselines/reference/scannerEnum1.js +++ /dev/null @@ -1,12 +0,0 @@ -//// [scannerEnum1.ts] - export enum CodeGenTarget { - ES3 = 0, - ES5 = 1, - } - -//// [scannerEnum1.js] -(function (CodeGenTarget) { - CodeGenTarget[CodeGenTarget["ES3"] = 0] = "ES3"; - CodeGenTarget[CodeGenTarget["ES5"] = 1] = "ES5"; -})(exports.CodeGenTarget || (exports.CodeGenTarget = {})); -var CodeGenTarget = exports.CodeGenTarget; diff --git a/tests/baselines/reference/thisInInvalidContextsExternalModule.errors.txt b/tests/baselines/reference/thisInInvalidContextsExternalModule.errors.txt index 99b2f784773..bb45d711ee2 100644 --- a/tests/baselines/reference/thisInInvalidContextsExternalModule.errors.txt +++ b/tests/baselines/reference/thisInInvalidContextsExternalModule.errors.txt @@ -61,7 +61,7 @@ } export = this; // Should be an error - ~~~~ -!!! Identifier expected. ~~~~~~~~ -!!! Cannot compile external modules unless the '--module' flag is provided. \ No newline at end of file +!!! Cannot compile external modules unless the '--module' flag is provided. + ~~~~ +!!! Identifier expected. \ No newline at end of file diff --git a/tests/baselines/reference/typeofANonExportedType.js b/tests/baselines/reference/typeofANonExportedType.js deleted file mode 100644 index a241eafeaa2..00000000000 --- a/tests/baselines/reference/typeofANonExportedType.js +++ /dev/null @@ -1,106 +0,0 @@ -//// [typeofANonExportedType.ts] -var x = 1; -export var r1: typeof x; -var y = { foo: '' }; -export var r2: typeof y; -class C { - foo: string; -} -export var c: C; -var c2: C; - -export var r3: typeof C; -export var r4: typeof c; -export var r4b: typeof c2; - -interface I { - foo: string; -} -export var i: I; -var i2: I; -export var r5: typeof i; -export var r5: typeof i2; - -module M { - export var foo = ''; - export class C { - foo: string; - } -} -export var r6: typeof M; -export var r7: typeof M.foo; - -import Z = M; -export var r8: typeof Z; -export var r9: typeof Z.foo; - -enum E { - A -} -export var r10: typeof E; -export var r11: typeof E.A; - -export var r12: typeof r12; - -function foo() { } -module foo { - export var y = 1; - export class C { - foo: string; - } -} -export var r13: typeof foo; - -//// [typeofANonExportedType.js] -var x = 1; -exports.r1; -var y = { foo: '' }; -exports.r2; -var C = (function () { - function C() { - } - return C; -})(); -exports.c; -var c2; -exports.r3; -exports.r4; -exports.r4b; -exports.i; -var i2; -exports.r5; -exports.r5; -var M; -(function (M) { - M.foo = ''; - var C = (function () { - function C() { - } - return C; - })(); - M.C = C; -})(M || (M = {})); -exports.r6; -exports.r7; -exports.r8; -exports.r9; -var E; -(function (E) { - E[E["A"] = 0] = "A"; -})(E || (E = {})); -exports.r10; -exports.r11; -exports.r12; -function foo() { -} -var foo; -(function (foo) { - foo.y = 1; - var C = (function () { - function C() { - } - return C; - })(); - foo.C = C; -})(foo || (foo = {})); -exports.r13; diff --git a/tests/baselines/reference/typeofAnExportedType.js b/tests/baselines/reference/typeofAnExportedType.js deleted file mode 100644 index 06dac0a8f8b..00000000000 --- a/tests/baselines/reference/typeofAnExportedType.js +++ /dev/null @@ -1,109 +0,0 @@ -//// [typeofAnExportedType.ts] -export var x = 1; -export var r1: typeof x; -export var y = { foo: '' }; -export var r2: typeof y; -export class C { - foo: string; -} -export var c: C; -var c2: C; - -export var r3: typeof C; -export var r4: typeof c; -export var r4b: typeof c2; - -export interface I { - foo: string; -} -export var i: I; -var i2: I; -export var r5: typeof i; -export var r5: typeof i2; - -export module M { - export var foo = ''; - export class C { - foo: string; - } -} -export var r6: typeof M; -export var r7: typeof M.foo; - -export import Z = M; -export var r8: typeof Z; -export var r9: typeof Z.foo; - -export enum E { - A -} -export var r10: typeof E; -export var r11: typeof E.A; - -export var r12: typeof r12; - -export function foo() { } -export module foo { - export var y = 1; - export class C { - foo: string; - } -} -export var r13: typeof foo; - -//// [typeofAnExportedType.js] -exports.x = 1; -exports.r1; -exports.y = { foo: '' }; -exports.r2; -var C = (function () { - function C() { - } - return C; -})(); -exports.C = C; -exports.c; -var c2; -exports.r3; -exports.r4; -exports.r4b; -exports.i; -var i2; -exports.r5; -exports.r5; -(function (M) { - M.foo = ''; - var C = (function () { - function C() { - } - return C; - })(); - M.C = C; -})(exports.M || (exports.M = {})); -var M = exports.M; -exports.r6; -exports.r7; -exports.Z = M; -exports.r8; -exports.r9; -(function (E) { - E[E["A"] = 0] = "A"; -})(exports.E || (exports.E = {})); -var E = exports.E; -exports.r10; -exports.r11; -exports.r12; -function foo() { -} -exports.foo = foo; -(function (foo) { - foo.y = 1; - var C = (function () { - function C() { - } - return C; - })(); - foo.C = C; -})(exports.foo || (exports.foo = {})); -var foo = exports.foo; -exports.r13;