From 5853aad4ae9f22efa852ba753dbbca7ee0b4e57a Mon Sep 17 00:00:00 2001 From: Yui Date: Wed, 1 Jun 2016 14:15:24 -0700 Subject: [PATCH] [Transforms] Update baselines from merging with master (#8898) * Update baselines from merging with master * Update sourcemap baselines Update sourcemap baselines * Update error baselines * Update baselines as the test-cases already include --module flag with amd * Fix baselines * Update baselines from merging with master. This is a fix in master (issue #8507) and the baselines was udpated in transforms before losing in merging master --- .../capturedParametersInInitializers2.js | 14 +- ...computedPropertyNamesSourceMap1_ES5.js.map | 2 +- ...dPropertyNamesSourceMap1_ES5.sourcemap.txt | 9 +- ...computedPropertyNamesSourceMap1_ES6.js.map | 2 +- ...dPropertyNamesSourceMap1_ES6.sourcemap.txt | 31 +- .../computedPropertyNamesSourceMap2_ES5.js | 14 +- ...computedPropertyNamesSourceMap2_ES5.js.map | 2 +- ...dPropertyNamesSourceMap2_ES5.sourcemap.txt | 62 +-- .../declarationEmit_UnknownImport2.js | 4 +- .../defaultExportInAwaitExpression01.js | 14 +- .../defaultExportInAwaitExpression02.js | 14 +- .../reference/es6ExportEqualsInterop.js | 411 +++++++++--------- .../reference/moduleElementsInWrongContext.js | 71 +-- .../moduleElementsInWrongContext2.js | 69 +-- .../moduleElementsInWrongContext3.js | 60 +-- .../optionsOutAndNoModuleGen.errors.txt | 9 +- .../parameterReferenceInInitializer1.js | 2 +- .../reference/tsxUnionTypeComponent1.js | 6 +- .../reference/tsxUnionTypeComponent2.js | 2 +- .../typeReferenceDirectives11.errors.txt | 18 - .../typeReferenceDirectives11.symbols | 23 + .../reference/typeReferenceDirectives11.types | 26 ++ .../typeReferenceDirectives12.errors.txt | 37 -- .../typeReferenceDirectives12.symbols | 68 +++ .../reference/typeReferenceDirectives12.types | 73 ++++ 25 files changed, 586 insertions(+), 457 deletions(-) delete mode 100644 tests/baselines/reference/typeReferenceDirectives11.errors.txt create mode 100644 tests/baselines/reference/typeReferenceDirectives11.symbols create mode 100644 tests/baselines/reference/typeReferenceDirectives11.types delete mode 100644 tests/baselines/reference/typeReferenceDirectives12.errors.txt create mode 100644 tests/baselines/reference/typeReferenceDirectives12.symbols create mode 100644 tests/baselines/reference/typeReferenceDirectives12.types diff --git a/tests/baselines/reference/capturedParametersInInitializers2.js b/tests/baselines/reference/capturedParametersInInitializers2.js index 8d2cd4d58cd..e2b492a012f 100644 --- a/tests/baselines/reference/capturedParametersInInitializers2.js +++ b/tests/baselines/reference/capturedParametersInInitializers2.js @@ -7,14 +7,16 @@ function foo2(y = class {[x] = x}, x = 1) { //// [capturedParametersInInitializers2.js] function foo(y, x) { - if (y === void 0) { y = (function () { - function class_1() { - } - class_1.c = x; - return class_1; - }()); } + if (y === void 0) { y = (_a = (function () { + function class_1() { + } + return class_1; + }()), + _a.c = x, + _a); } if (x === void 0) { x = 1; } y.c; + var _a; } function foo2(y, x) { if (y === void 0) { y = (function () { diff --git a/tests/baselines/reference/computedPropertyNamesSourceMap1_ES5.js.map b/tests/baselines/reference/computedPropertyNamesSourceMap1_ES5.js.map index e94da4e3f80..114df45af46 100644 --- a/tests/baselines/reference/computedPropertyNamesSourceMap1_ES5.js.map +++ b/tests/baselines/reference/computedPropertyNamesSourceMap1_ES5.js.map @@ -1,2 +1,2 @@ //// [computedPropertyNamesSourceMap1_ES5.js.map] -{"version":3,"file":"computedPropertyNamesSourceMap1_ES5.js","sourceRoot":"","sources":["computedPropertyNamesSourceMap1_ES5.ts"],"names":[],"mappings":"AAAA;IAAA;IAOA,CAAC;IANG,YAAC,OAAO,CAAC,GAAT;QACI,QAAQ,CAAC;IACb,CAAC;IACD,sBAAI,aAAC,SAAU;aAAf;YACF,MAAM,CAAC,CAAC,CAAC;QACP,CAAC;;;OAAA;IACL,QAAC;AAAD,CAAC,AAPD,IAOC"} \ No newline at end of file +{"version":3,"file":"computedPropertyNamesSourceMap1_ES5.js","sourceRoot":"","sources":["computedPropertyNamesSourceMap1_ES5.ts"],"names":[],"mappings":"AAAA;IAAA;IAOA,CAAC;IANG,YAAC,OAAO,CAAC,GAAT;QACI,QAAQ,CAAC;IACb,CAAC;IACD,sBAAI,sBAAW;aAAf;YACF,MAAM,CAAC,CAAC,CAAC;QACP,CAAC;;;OAAA;IACL,QAAC;AAAD,CAAC,AAPD,IAOC"} \ No newline at end of file diff --git a/tests/baselines/reference/computedPropertyNamesSourceMap1_ES5.sourcemap.txt b/tests/baselines/reference/computedPropertyNamesSourceMap1_ES5.sourcemap.txt index 41484b97c66..fc571a3140e 100644 --- a/tests/baselines/reference/computedPropertyNamesSourceMap1_ES5.sourcemap.txt +++ b/tests/baselines/reference/computedPropertyNamesSourceMap1_ES5.sourcemap.txt @@ -78,17 +78,14 @@ sourceFile:computedPropertyNamesSourceMap1_ES5.ts >>> Object.defineProperty(C.prototype, "goodbye", { 1->^^^^ 2 > ^^^^^^^^^^^^^^^^^^^^^^ -3 > ^^^^^^^^^^^^^ -4 > ^^^^^^^^^ +3 > ^^^^^^^^^^^^^^^^^^^^^^ 1-> > 2 > get -3 > [ -4 > "goodbye"] +3 > ["goodbye"] 1->Emitted(7, 5) Source(5, 5) + SourceIndex(0) 2 >Emitted(7, 27) Source(5, 9) + SourceIndex(0) -3 >Emitted(7, 40) Source(5, 10) + SourceIndex(0) -4 >Emitted(7, 49) Source(5, 20) + SourceIndex(0) +3 >Emitted(7, 49) Source(5, 20) + SourceIndex(0) --- >>> get: function () { 1 >^^^^^^^^^^^^^ diff --git a/tests/baselines/reference/computedPropertyNamesSourceMap1_ES6.js.map b/tests/baselines/reference/computedPropertyNamesSourceMap1_ES6.js.map index 0c9a609211f..64c3283f702 100644 --- a/tests/baselines/reference/computedPropertyNamesSourceMap1_ES6.js.map +++ b/tests/baselines/reference/computedPropertyNamesSourceMap1_ES6.js.map @@ -1,2 +1,2 @@ //// [computedPropertyNamesSourceMap1_ES6.js.map] -{"version":3,"file":"computedPropertyNamesSourceMap1_ES6.js","sourceRoot":"","sources":["computedPropertyNamesSourceMap1_ES6.ts"],"names":[],"mappings":"AAAA;IACI,CAAC,OAAO,CAAC;QACL,QAAQ,CAAC;IAChB,CAAC;IACD,IAAI,CAAC,SAAS,CAAC;QACd,MAAM,CAAC,CAAC,CAAC;IACV,CAAC;AACF,CAAC;AAAA"} \ No newline at end of file +{"version":3,"file":"computedPropertyNamesSourceMap1_ES6.js","sourceRoot":"","sources":["computedPropertyNamesSourceMap1_ES6.ts"],"names":[],"mappings":"AAAA;IACI,CAAC,OAAO,CAAC;QACL,QAAQ,CAAC;IAChB,CAAC;IACD,IAAI,CAAC,SAAS,CAAC;QACd,MAAM,CAAC,CAAC,CAAC;IACV,CAAC;CACD"} \ No newline at end of file diff --git a/tests/baselines/reference/computedPropertyNamesSourceMap1_ES6.sourcemap.txt b/tests/baselines/reference/computedPropertyNamesSourceMap1_ES6.sourcemap.txt index 4952f456e85..2463a24e085 100644 --- a/tests/baselines/reference/computedPropertyNamesSourceMap1_ES6.sourcemap.txt +++ b/tests/baselines/reference/computedPropertyNamesSourceMap1_ES6.sourcemap.txt @@ -20,7 +20,7 @@ sourceFile:computedPropertyNamesSourceMap1_ES6.ts 3 > ^^^^^^^ 4 > ^ 5 > ^^^^^-> -1->class C { +1->class C { > 2 > [ 3 > "hello" @@ -34,7 +34,7 @@ sourceFile:computedPropertyNamesSourceMap1_ES6.ts 1->^^^^^^^^ 2 > ^^^^^^^^ 3 > ^ -1->() { +1->() { > 2 > debugger 3 > ; @@ -46,7 +46,7 @@ sourceFile:computedPropertyNamesSourceMap1_ES6.ts 1 >^^^^ 2 > ^ 3 > ^^^^^^^^^^^^^^^^^^^-> -1 > +1 > > 2 > } 1 >Emitted(4, 5) Source(4, 2) + SourceIndex(0) @@ -58,7 +58,7 @@ sourceFile:computedPropertyNamesSourceMap1_ES6.ts 3 > ^ 4 > ^^^^^^^^^ 5 > ^ -1-> +1-> > 2 > get 3 > [ @@ -76,7 +76,7 @@ sourceFile:computedPropertyNamesSourceMap1_ES6.ts 3 > ^ 4 > ^ 5 > ^ -1 >() { +1 >() { > 2 > return 3 > @@ -91,24 +91,17 @@ sourceFile:computedPropertyNamesSourceMap1_ES6.ts >>> } 1 >^^^^ 2 > ^ -1 > +1 > > 2 > } 1 >Emitted(7, 5) Source(7, 2) + SourceIndex(0) 2 >Emitted(7, 6) Source(7, 3) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(8, 1) Source(8, 1) + SourceIndex(0) -2 >Emitted(8, 2) Source(8, 2) + SourceIndex(0) +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(8, 2) Source(8, 2) + SourceIndex(0) --- ->>>//# sourceMappingURL=computedPropertyNamesSourceMap1_ES6.js.map1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1-> -1->Emitted(9, 1) Source(8, 2) + SourceIndex(0) ---- \ No newline at end of file +>>>//# sourceMappingURL=computedPropertyNamesSourceMap1_ES6.js.map \ No newline at end of file diff --git a/tests/baselines/reference/computedPropertyNamesSourceMap2_ES5.js b/tests/baselines/reference/computedPropertyNamesSourceMap2_ES5.js index 844dc2fef93..d214a1ef99d 100644 --- a/tests/baselines/reference/computedPropertyNamesSourceMap2_ES5.js +++ b/tests/baselines/reference/computedPropertyNamesSourceMap2_ES5.js @@ -1,11 +1,11 @@ //// [computedPropertyNamesSourceMap2_ES5.ts] -var v = { - ["hello"]() { - debugger; - }, - get ["goodbye"]() { - return 0; - } +var v = { + ["hello"]() { + debugger; + }, + get ["goodbye"]() { + return 0; + } } //// [computedPropertyNamesSourceMap2_ES5.js] diff --git a/tests/baselines/reference/computedPropertyNamesSourceMap2_ES5.js.map b/tests/baselines/reference/computedPropertyNamesSourceMap2_ES5.js.map index 74c3e241086..36259a4c7cb 100644 --- a/tests/baselines/reference/computedPropertyNamesSourceMap2_ES5.js.map +++ b/tests/baselines/reference/computedPropertyNamesSourceMap2_ES5.js.map @@ -1,2 +1,2 @@ //// [computedPropertyNamesSourceMap2_ES5.js.map] -{"version":3,"file":"computedPropertyNamesSourceMap2_ES5.js","sourceRoot":"","sources":["computedPropertyNamesSourceMap2_ES5.ts"],"names":[],"mappings":"AAAA,IAAI,CAAC,GAAG;IACJ,GAAC,OAAO,CAAC,GAAT;QACI,QAAQ,CAAC;IAChB,CAAC;IACE,0BAAK,SAAU;aAAf;YACF,MAAM,CAAC,CAAC,CAAC;QACV,CAAC;;;MAAA;;CACD,CAAA"} \ No newline at end of file +{"version":3,"file":"computedPropertyNamesSourceMap2_ES5.js","sourceRoot":"","sources":["computedPropertyNamesSourceMap2_ES5.ts"],"names":[],"mappings":"AAAA,IAAI,CAAC;IACD,GAAC,OAAO,IAAR;QACI,QAAQ,CAAC;IAChB,CAAC;0BACM,aAAW;aAAf;YACF,MAAM,CAAC,CAAC,CAAC;QACV,CAAC;;;;OACD,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/computedPropertyNamesSourceMap2_ES5.sourcemap.txt b/tests/baselines/reference/computedPropertyNamesSourceMap2_ES5.sourcemap.txt index 5919711a322..aa20d1d7960 100644 --- a/tests/baselines/reference/computedPropertyNamesSourceMap2_ES5.sourcemap.txt +++ b/tests/baselines/reference/computedPropertyNamesSourceMap2_ES5.sourcemap.txt @@ -12,40 +12,34 @@ sourceFile:computedPropertyNamesSourceMap2_ES5.ts 1 > 2 >^^^^ 3 > ^ -4 > ^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^-> +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > 2 >var 3 > v -4 > = 1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) 2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) 3 >Emitted(1, 6) Source(1, 6) + SourceIndex(0) -4 >Emitted(1, 9) Source(1, 9) + SourceIndex(0) --- >>> _a["hello"] = function () { 1->^^^^ 2 > ^^^ 3 > ^^^^^^^ -4 > ^ -5 > ^^^ -1->{ +4 > ^^^^ +1-> = { > 2 > [ 3 > "hello" -4 > ] -5 > +4 > 1->Emitted(2, 5) Source(2, 5) + SourceIndex(0) 2 >Emitted(2, 8) Source(2, 6) + SourceIndex(0) 3 >Emitted(2, 15) Source(2, 13) + SourceIndex(0) -4 >Emitted(2, 16) Source(2, 14) + SourceIndex(0) -5 >Emitted(2, 19) Source(2, 5) + SourceIndex(0) +4 >Emitted(2, 19) Source(2, 5) + SourceIndex(0) --- >>> debugger; 1 >^^^^^^^^ 2 > ^^^^^^^^ 3 > ^ -1 >["hello"]() { +1 >["hello"]() { > 2 > debugger 3 > ; @@ -57,23 +51,20 @@ sourceFile:computedPropertyNamesSourceMap2_ES5.ts 1 >^^^^ 2 > ^ 3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > +1 > > 2 > } 1 >Emitted(4, 5) Source(4, 2) + SourceIndex(0) 2 >Emitted(4, 6) Source(4, 3) + SourceIndex(0) --- >>> Object.defineProperty(_a, "goodbye", { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^^^^^^^^^ -1->, - > -2 > get [ -3 > "goodbye"] -1->Emitted(5, 5) Source(5, 5) + SourceIndex(0) -2 >Emitted(5, 31) Source(5, 10) + SourceIndex(0) -3 >Emitted(5, 40) Source(5, 20) + SourceIndex(0) +1->^^^^^^^^^^^^^^^^^^^^^^^^^^ +2 > ^^^^^^^^^^^^^ +1->, + > get +2 > ["goodbye"] +1->Emitted(5, 27) Source(5, 9) + SourceIndex(0) +2 >Emitted(5, 40) Source(5, 20) + SourceIndex(0) --- >>> get: function () { 1 >^^^^^^^^^^^^^ @@ -87,7 +78,7 @@ sourceFile:computedPropertyNamesSourceMap2_ES5.ts 3 > ^ 4 > ^ 5 > ^ -1->get ["goodbye"]() { +1->get ["goodbye"]() { > 2 > return 3 > @@ -103,7 +94,7 @@ sourceFile:computedPropertyNamesSourceMap2_ES5.ts 1 >^^^^^^^^ 2 > ^ 3 > ^^^^^^^^^^^^^^^^^-> -1 > +1 > > 2 > } 1 >Emitted(8, 9) Source(7, 2) + SourceIndex(0) @@ -112,21 +103,14 @@ sourceFile:computedPropertyNamesSourceMap2_ES5.ts >>> enumerable: true, >>> configurable: true >>> }), -1->^^^^^^ -2 > ^-> -1-> -1->Emitted(11, 7) Source(7, 3) + SourceIndex(0) ---- ->>> _a ->>>); -1->^ -2 > ^ -3 > ^^^^^^-> -1-> +>>> _a); +1->^^^^^^^ +2 > ^ +1-> >} -2 > -1->Emitted(13, 2) Source(8, 2) + SourceIndex(0) -2 >Emitted(13, 3) Source(8, 2) + SourceIndex(0) +2 > +1->Emitted(12, 8) Source(8, 2) + SourceIndex(0) +2 >Emitted(12, 9) Source(8, 2) + SourceIndex(0) --- >>>var _a; >>>//# sourceMappingURL=computedPropertyNamesSourceMap2_ES5.js.map \ No newline at end of file diff --git a/tests/baselines/reference/declarationEmit_UnknownImport2.js b/tests/baselines/reference/declarationEmit_UnknownImport2.js index cdb8fe6bbb0..7f20d9ec9b8 100644 --- a/tests/baselines/reference/declarationEmit_UnknownImport2.js +++ b/tests/baselines/reference/declarationEmit_UnknownImport2.js @@ -1,6 +1,6 @@ //// [declarationEmit_UnknownImport2.ts] - -import Foo From './Foo'; // Syntax error + +import Foo From './Foo'; // Syntax error export default Foo //// [declarationEmit_UnknownImport2.js] diff --git a/tests/baselines/reference/defaultExportInAwaitExpression01.js b/tests/baselines/reference/defaultExportInAwaitExpression01.js index 80c1eeff20a..b57b6237d7a 100644 --- a/tests/baselines/reference/defaultExportInAwaitExpression01.js +++ b/tests/baselines/reference/defaultExportInAwaitExpression01.js @@ -1,15 +1,15 @@ //// [tests/cases/conformance/es6/modules/defaultExportInAwaitExpression01.ts] //// //// [a.ts] -const x = new Promise( ( resolve, reject ) => { resolve( {} ); } ); -export default x; +const x = new Promise( ( resolve, reject ) => { resolve( {} ); } ); +export default x; //// [b.ts] -import x from './a'; - -( async function() { - const value = await x; -}() ); +import x from './a'; + +( async function() { + const value = await x; +}() ); //// [a.js] diff --git a/tests/baselines/reference/defaultExportInAwaitExpression02.js b/tests/baselines/reference/defaultExportInAwaitExpression02.js index 7b80e64363c..db2150c66f1 100644 --- a/tests/baselines/reference/defaultExportInAwaitExpression02.js +++ b/tests/baselines/reference/defaultExportInAwaitExpression02.js @@ -1,15 +1,15 @@ //// [tests/cases/conformance/es6/modules/defaultExportInAwaitExpression02.ts] //// //// [a.ts] -const x = new Promise( ( resolve, reject ) => { resolve( {} ); } ); -export default x; +const x = new Promise( ( resolve, reject ) => { resolve( {} ); } ); +export default x; //// [b.ts] -import x from './a'; - -( async function() { - const value = await x; -}() ); +import x from './a'; + +( async function() { + const value = await x; +}() ); //// [a.js] diff --git a/tests/baselines/reference/es6ExportEqualsInterop.js b/tests/baselines/reference/es6ExportEqualsInterop.js index f8f32d4bccf..49a8a7e435a 100644 --- a/tests/baselines/reference/es6ExportEqualsInterop.js +++ b/tests/baselines/reference/es6ExportEqualsInterop.js @@ -1,210 +1,210 @@ //// [tests/cases/compiler/es6ExportEqualsInterop.ts] //// //// [modules.d.ts] - -declare module "interface" { - interface Foo { - x: number; - y: number; - } - export = Foo; -} - -declare module "variable" { - var Foo: { - a: number; - b: number; - } - export = Foo; -} - -declare module "interface-variable" { - interface Foo { - x: number; - y: number; - } - var Foo: { - a: number; - b: number; - } - export = Foo; -} - -declare module "module" { - module Foo { - export var a: number; - export var b: number; - } - export = Foo; -} - -declare module "interface-module" { - interface Foo { - x: number; - y: number; - } - module Foo { - export var a: number; - export var b: number; - } - export = Foo; -} - -declare module "variable-module" { - module Foo { - interface Bar { - x: number; - y: number; - } - } - var Foo: { - a: number; - b: number; - } - export = Foo; -} - -declare module "function" { - function foo(); - export = foo; -} - -declare module "function-module" { - function foo(); - module foo { - export var a: number; - export var b: number; - } - export = foo; -} - -declare module "class" { - class Foo { - x: number; - y: number; - } - export = Foo; -} - -declare module "class-module" { - class Foo { - x: number; - y: number; - } - module Foo { - export var a: number; - export var b: number; - } - export = Foo; -} + +declare module "interface" { + interface Foo { + x: number; + y: number; + } + export = Foo; +} + +declare module "variable" { + var Foo: { + a: number; + b: number; + } + export = Foo; +} + +declare module "interface-variable" { + interface Foo { + x: number; + y: number; + } + var Foo: { + a: number; + b: number; + } + export = Foo; +} + +declare module "module" { + module Foo { + export var a: number; + export var b: number; + } + export = Foo; +} + +declare module "interface-module" { + interface Foo { + x: number; + y: number; + } + module Foo { + export var a: number; + export var b: number; + } + export = Foo; +} + +declare module "variable-module" { + module Foo { + interface Bar { + x: number; + y: number; + } + } + var Foo: { + a: number; + b: number; + } + export = Foo; +} + +declare module "function" { + function foo(); + export = foo; +} + +declare module "function-module" { + function foo(); + module foo { + export var a: number; + export var b: number; + } + export = foo; +} + +declare module "class" { + class Foo { + x: number; + y: number; + } + export = Foo; +} + +declare module "class-module" { + class Foo { + x: number; + y: number; + } + module Foo { + export var a: number; + export var b: number; + } + export = Foo; +} //// [main.ts] -/// - -// import-equals -import z1 = require("interface"); -import z2 = require("variable"); -import z3 = require("interface-variable"); -import z4 = require("module"); -import z5 = require("interface-module"); -import z6 = require("variable-module"); -import z7 = require("function"); -import z8 = require("function-module"); -import z9 = require("class"); -import z0 = require("class-module"); - -z1.a; -z2.a; -z3.a; -z4.a; -z5.a; -z6.a; -z7.a; -z8.a; -z9.a; -z0.a; - -// default import -import x1 from "interface"; -import x2 from "variable"; -import x3 from "interface-variable"; -import x4 from "module"; -import x5 from "interface-module"; -import x6 from "variable-module"; -import x7 from "function"; -import x8 from "function-module"; -import x9 from "class"; -import x0 from "class-module"; - -// namespace import -import * as y1 from "interface"; -import * as y2 from "variable"; -import * as y3 from "interface-variable"; -import * as y4 from "module"; -import * as y5 from "interface-module"; -import * as y6 from "variable-module"; -import * as y7 from "function"; -import * as y8 from "function-module"; -import * as y9 from "class"; -import * as y0 from "class-module"; - -y1.a; -y2.a; -y3.a; -y4.a; -y5.a; -y6.a; -y7.a; -y8.a; -y9.a; -y0.a; - -// named import -import { a as a1 } from "interface"; -import { a as a2 } from "variable"; -import { a as a3 } from "interface-variable"; -import { a as a4 } from "module"; -import { a as a5 } from "interface-module"; -import { a as a6 } from "variable-module"; -import { a as a7 } from "function"; -import { a as a8 } from "function-module"; -import { a as a9 } from "class"; -import { a as a0 } from "class-module"; - -a1; -a2; -a3; -a4; -a5; -a6; -a7; -a8; -a9; -a0; - -// named export -export { a as a1 } from "interface"; -export { a as a2 } from "variable"; -export { a as a3 } from "interface-variable"; -export { a as a4 } from "module"; -export { a as a5 } from "interface-module"; -export { a as a6 } from "variable-module"; -export { a as a7 } from "function"; -export { a as a8 } from "function-module"; -export { a as a9 } from "class"; -export { a as a0 } from "class-module"; - -// export-star -export * from "interface"; -export * from "variable"; -export * from "interface-variable"; -export * from "module"; -export * from "interface-module"; -export * from "variable-module"; -export * from "function"; -export * from "function-module"; -export * from "class"; -export * from "class-module"; +/// + +// import-equals +import z1 = require("interface"); +import z2 = require("variable"); +import z3 = require("interface-variable"); +import z4 = require("module"); +import z5 = require("interface-module"); +import z6 = require("variable-module"); +import z7 = require("function"); +import z8 = require("function-module"); +import z9 = require("class"); +import z0 = require("class-module"); + +z1.a; +z2.a; +z3.a; +z4.a; +z5.a; +z6.a; +z7.a; +z8.a; +z9.a; +z0.a; + +// default import +import x1 from "interface"; +import x2 from "variable"; +import x3 from "interface-variable"; +import x4 from "module"; +import x5 from "interface-module"; +import x6 from "variable-module"; +import x7 from "function"; +import x8 from "function-module"; +import x9 from "class"; +import x0 from "class-module"; + +// namespace import +import * as y1 from "interface"; +import * as y2 from "variable"; +import * as y3 from "interface-variable"; +import * as y4 from "module"; +import * as y5 from "interface-module"; +import * as y6 from "variable-module"; +import * as y7 from "function"; +import * as y8 from "function-module"; +import * as y9 from "class"; +import * as y0 from "class-module"; + +y1.a; +y2.a; +y3.a; +y4.a; +y5.a; +y6.a; +y7.a; +y8.a; +y9.a; +y0.a; + +// named import +import { a as a1 } from "interface"; +import { a as a2 } from "variable"; +import { a as a3 } from "interface-variable"; +import { a as a4 } from "module"; +import { a as a5 } from "interface-module"; +import { a as a6 } from "variable-module"; +import { a as a7 } from "function"; +import { a as a8 } from "function-module"; +import { a as a9 } from "class"; +import { a as a0 } from "class-module"; + +a1; +a2; +a3; +a4; +a5; +a6; +a7; +a8; +a9; +a0; + +// named export +export { a as a1 } from "interface"; +export { a as a2 } from "variable"; +export { a as a3 } from "interface-variable"; +export { a as a4 } from "module"; +export { a as a5 } from "interface-module"; +export { a as a6 } from "variable-module"; +export { a as a7 } from "function"; +export { a as a8 } from "function-module"; +export { a as a9 } from "class"; +export { a as a0 } from "class-module"; + +// export-star +export * from "interface"; +export * from "variable"; +export * from "interface-variable"; +export * from "module"; +export * from "interface-module"; +export * from "variable-module"; +export * from "function"; +export * from "function-module"; +export * from "class"; +export * from "class-module"; //// [main.js] @@ -274,6 +274,9 @@ function_1.a; function_module_1.a; class_1.a; class_module_1.a; +// named export +var interface_2 = require("interface"); +exports.a1 = interface_2.a; var variable_2 = require("variable"); exports.a2 = variable_2.a; var interface_variable_2 = require("interface-variable"); @@ -284,8 +287,12 @@ var interface_module_2 = require("interface-module"); exports.a5 = interface_module_2.a; var variable_module_2 = require("variable-module"); exports.a6 = variable_module_2.a; +var function_2 = require("function"); +exports.a7 = function_2.a; var function_module_2 = require("function-module"); exports.a8 = function_module_2.a; +var class_2 = require("class"); +exports.a9 = class_2.a; var class_module_2 = require("class-module"); exports.a0 = class_module_2.a; __export(require("variable")); diff --git a/tests/baselines/reference/moduleElementsInWrongContext.js b/tests/baselines/reference/moduleElementsInWrongContext.js index 2325b51e1b3..7cd2af405e2 100644 --- a/tests/baselines/reference/moduleElementsInWrongContext.js +++ b/tests/baselines/reference/moduleElementsInWrongContext.js @@ -1,48 +1,53 @@ //// [moduleElementsInWrongContext.ts] +{ + module M { } + export namespace N { + export interface I { } + } + + namespace Q.K { } + + declare module "ambient" { + + } + + export = M; + + var v; + function foo() { } + export * from "ambient"; + export { foo }; + export { baz as b } from "ambient"; + export default v; + export default class C { } + export function bee() { } + import I = M; + import I2 = require("foo"); + import * as Foo from "ambient"; + import bar from "ambient"; + import { baz } from "ambient"; + import "ambient"; +} + + +//// [moduleElementsInWrongContext.js] { - module M { } - export namespace N { - export interface I { } - } - - namespace Q.K { } - - declare module "ambient" { - - } - export = M; - var v; function foo() { } export * from "ambient"; export { foo }; export { baz as b } from "ambient"; export default v; - export default class C { } - export function bee() { } - import I = M; + var C = (function () { + function C() { + } + return C; + }()); + function bee() { } import I2 = require("foo"); import * as Foo from "ambient"; import bar from "ambient"; import { baz } from "ambient"; import "ambient"; } - - -//// [moduleElementsInWrongContext.js] -{ - var v; - function foo() { } - var ambient_2 = require("ambient"); - exports.b = ambient_2.baz; - exports["default"] = v; - var C = (function () { - function C() { - } - return C; - }()); - exports["default"] = C; - function bee() { } - exports.bee = bee; -} diff --git a/tests/baselines/reference/moduleElementsInWrongContext2.js b/tests/baselines/reference/moduleElementsInWrongContext2.js index 17ba6138547..55dd133ec95 100644 --- a/tests/baselines/reference/moduleElementsInWrongContext2.js +++ b/tests/baselines/reference/moduleElementsInWrongContext2.js @@ -1,48 +1,53 @@ //// [moduleElementsInWrongContext2.ts] -function blah () { - module M { } - export namespace N { - export interface I { } - } +function blah () { + module M { } + export namespace N { + export interface I { } + } + + namespace Q.K { } + + declare module "ambient" { + + } + + export = M; + + var v; + function foo() { } + export * from "ambient"; + export { foo }; + export { baz as b } from "ambient"; + export default v; + export default class C { } + export function bee() { } + import I = M; + import I2 = require("foo"); + import * as Foo from "ambient"; + import bar from "ambient"; + import { baz } from "ambient"; + import "ambient"; +} - namespace Q.K { } - - declare module "ambient" { - - } +//// [moduleElementsInWrongContext2.js] +function blah() { export = M; - var v; function foo() { } export * from "ambient"; export { foo }; export { baz as b } from "ambient"; export default v; - export default class C { } - export function bee() { } - import I = M; + var C = (function () { + function C() { + } + return C; + }()); + function bee() { } import I2 = require("foo"); import * as Foo from "ambient"; import bar from "ambient"; import { baz } from "ambient"; import "ambient"; } - - -//// [moduleElementsInWrongContext2.js] -function blah() { - var v; - function foo() { } - var ambient_2 = require("ambient"); - exports.b = ambient_2.baz; - exports["default"] = v; - var C = (function () { - function C() { - } - return C; - }()); - exports["default"] = C; - function bee() { } - exports.bee = bee; -} diff --git a/tests/baselines/reference/moduleElementsInWrongContext3.js b/tests/baselines/reference/moduleElementsInWrongContext3.js index e9a5f1e1ede..76220eab251 100644 --- a/tests/baselines/reference/moduleElementsInWrongContext3.js +++ b/tests/baselines/reference/moduleElementsInWrongContext3.js @@ -1,34 +1,34 @@ //// [moduleElementsInWrongContext3.ts] -module P { - { - module M { } - export namespace N { - export interface I { } - } - - namespace Q.K { } - - declare module "ambient" { - - } - - export = M; - - var v; - function foo() { } - export * from "ambient"; - export { foo }; - export { baz as b } from "ambient"; - export default v; - export default class C { } - export function bee() { } - import I = M; - import I2 = require("foo"); - import * as Foo from "ambient"; - import bar from "ambient"; - import { baz } from "ambient"; - import "ambient"; - } +module P { + { + module M { } + export namespace N { + export interface I { } + } + + namespace Q.K { } + + declare module "ambient" { + + } + + export = M; + + var v; + function foo() { } + export * from "ambient"; + export { foo }; + export { baz as b } from "ambient"; + export default v; + export default class C { } + export function bee() { } + import I = M; + import I2 = require("foo"); + import * as Foo from "ambient"; + import bar from "ambient"; + import { baz } from "ambient"; + import "ambient"; + } } //// [moduleElementsInWrongContext3.js] diff --git a/tests/baselines/reference/optionsOutAndNoModuleGen.errors.txt b/tests/baselines/reference/optionsOutAndNoModuleGen.errors.txt index b4d00619993..9fa887c53b3 100644 --- a/tests/baselines/reference/optionsOutAndNoModuleGen.errors.txt +++ b/tests/baselines/reference/optionsOutAndNoModuleGen.errors.txt @@ -1,7 +1,8 @@ -error TS6082: Only 'amd' and 'system' modules are supported alongside --out. +tests/cases/compiler/optionsOutAndNoModuleGen.ts(2,1): error TS6131: Cannot compile modules using option 'out' unless the '--module' flag is 'amd' or 'system'. -!!! error TS6082: Only 'amd' and 'system' modules are supported alongside --out. -==== tests/cases/compiler/optionsOutAndNoModuleGen.ts (0 errors) ==== +==== tests/cases/compiler/optionsOutAndNoModuleGen.ts (1 errors) ==== - export var x = 10; \ No newline at end of file + export var x = 10; + ~~~~~~~~~~~~~~~~~~ +!!! error TS6131: Cannot compile modules using option 'out' unless the '--module' flag is 'amd' or 'system'. \ No newline at end of file diff --git a/tests/baselines/reference/parameterReferenceInInitializer1.js b/tests/baselines/reference/parameterReferenceInInitializer1.js index 51f98603de8..ee49eb83fe1 100644 --- a/tests/baselines/reference/parameterReferenceInInitializer1.js +++ b/tests/baselines/reference/parameterReferenceInInitializer1.js @@ -18,7 +18,7 @@ function fn(y, set) { } var C = (function () { function C(y, x // expected to work, but actually doesn't - ) { + ) { if (x === void 0) { x = fn(y, function (y, x) { return y.x = x; }); } this.x = x; } diff --git a/tests/baselines/reference/tsxUnionTypeComponent1.js b/tests/baselines/reference/tsxUnionTypeComponent1.js index 11b41a2aa3d..444542068be 100644 --- a/tests/baselines/reference/tsxUnionTypeComponent1.js +++ b/tests/baselines/reference/tsxUnionTypeComponent1.js @@ -31,7 +31,7 @@ var __extends = (this && this.__extends) || function (d, b) { function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; -var React = require('react'); +var React = require("react"); var MyComponent = (function (_super) { __extends(MyComponent, _super); function MyComponent() { @@ -44,7 +44,7 @@ var MyComponent = (function (_super) { return MyComponent; }(React.Component)); // Stateless Component As Props -React.createElement(MyComponent, {AnyComponent: function () { return React.createElement("button", null, "test"); }}); +React.createElement(MyComponent, { AnyComponent: function () { return React.createElement("button", null, "test"); } }); // Component Class as Props var MyButtonComponent = (function (_super) { __extends(MyButtonComponent, _super); @@ -53,4 +53,4 @@ var MyButtonComponent = (function (_super) { } return MyButtonComponent; }(React.Component)); -React.createElement(MyComponent, {AnyComponent: MyButtonComponent}); +React.createElement(MyComponent, { AnyComponent: MyButtonComponent }); diff --git a/tests/baselines/reference/tsxUnionTypeComponent2.js b/tests/baselines/reference/tsxUnionTypeComponent2.js index 18e86eb8b4c..b2be1b880b5 100644 --- a/tests/baselines/reference/tsxUnionTypeComponent2.js +++ b/tests/baselines/reference/tsxUnionTypeComponent2.js @@ -13,6 +13,6 @@ const X: Invalid1 = "Should fail to construct"; //// [file.js] "use strict"; -var React = require('react'); +var React = require("react"); var X = "Should fail to construct"; React.createElement(X, null); diff --git a/tests/baselines/reference/typeReferenceDirectives11.errors.txt b/tests/baselines/reference/typeReferenceDirectives11.errors.txt deleted file mode 100644 index 45433bf3b83..00000000000 --- a/tests/baselines/reference/typeReferenceDirectives11.errors.txt +++ /dev/null @@ -1,18 +0,0 @@ -/mod1.ts(2,17): error TS6131: Cannot compile modules using option 'out' unless the '--module' flag is 'amd' or 'system'. - - -==== /mod2.ts (0 errors) ==== - - import {foo} from "./mod1"; - export const bar = foo(); -==== /types/lib/index.d.ts (0 errors) ==== - - - interface Lib { x } - -==== /mod1.ts (1 errors) ==== - - export function foo(): Lib { return {x: 1} } - ~~~ -!!! error TS6131: Cannot compile modules using option 'out' unless the '--module' flag is 'amd' or 'system'. - \ No newline at end of file diff --git a/tests/baselines/reference/typeReferenceDirectives11.symbols b/tests/baselines/reference/typeReferenceDirectives11.symbols new file mode 100644 index 00000000000..875bb2a0900 --- /dev/null +++ b/tests/baselines/reference/typeReferenceDirectives11.symbols @@ -0,0 +1,23 @@ +=== /mod2.ts === + +import {foo} from "./mod1"; +>foo : Symbol(foo, Decl(mod2.ts, 1, 8)) + +export const bar = foo(); +>bar : Symbol(bar, Decl(mod2.ts, 2, 12)) +>foo : Symbol(foo, Decl(mod2.ts, 1, 8)) + +=== /types/lib/index.d.ts === + + +interface Lib { x } +>Lib : Symbol(Lib, Decl(index.d.ts, 0, 0)) +>x : Symbol(Lib.x, Decl(index.d.ts, 2, 15)) + +=== /mod1.ts === + +export function foo(): Lib { return {x: 1} } +>foo : Symbol(foo, Decl(mod1.ts, 0, 0)) +>Lib : Symbol(Lib, Decl(index.d.ts, 0, 0)) +>x : Symbol(x, Decl(mod1.ts, 1, 37)) + diff --git a/tests/baselines/reference/typeReferenceDirectives11.types b/tests/baselines/reference/typeReferenceDirectives11.types new file mode 100644 index 00000000000..93d80b7988a --- /dev/null +++ b/tests/baselines/reference/typeReferenceDirectives11.types @@ -0,0 +1,26 @@ +=== /mod2.ts === + +import {foo} from "./mod1"; +>foo : () => Lib + +export const bar = foo(); +>bar : Lib +>foo() : Lib +>foo : () => Lib + +=== /types/lib/index.d.ts === + + +interface Lib { x } +>Lib : Lib +>x : any + +=== /mod1.ts === + +export function foo(): Lib { return {x: 1} } +>foo : () => Lib +>Lib : Lib +>{x: 1} : { x: number; } +>x : number +>1 : number + diff --git a/tests/baselines/reference/typeReferenceDirectives12.errors.txt b/tests/baselines/reference/typeReferenceDirectives12.errors.txt deleted file mode 100644 index c1b3a6126b2..00000000000 --- a/tests/baselines/reference/typeReferenceDirectives12.errors.txt +++ /dev/null @@ -1,37 +0,0 @@ -/main.ts(1,14): error TS6131: Cannot compile modules using option 'out' unless the '--module' flag is 'amd' or 'system'. - - -==== /mod2.ts (0 errors) ==== - import { Cls } from "./main"; - import "./mod1"; - - export const cls = Cls; - export const foo = new Cls().foo(); - export const bar = Cls.bar(); -==== /types/lib/index.d.ts (0 errors) ==== - - - interface Lib { x } - -==== /main.ts (1 errors) ==== - export class Cls { - ~~~ -!!! error TS6131: Cannot compile modules using option 'out' unless the '--module' flag is 'amd' or 'system'. - x - } - -==== /mod1.ts (0 errors) ==== - /// - - import {Cls} from "./main"; - Cls.prototype.foo = function() { return undefined; } - - declare module "./main" { - interface Cls { - foo(): Lib; - } - namespace Cls { - function bar(): Lib; - } - } - \ No newline at end of file diff --git a/tests/baselines/reference/typeReferenceDirectives12.symbols b/tests/baselines/reference/typeReferenceDirectives12.symbols new file mode 100644 index 00000000000..30b24c39284 --- /dev/null +++ b/tests/baselines/reference/typeReferenceDirectives12.symbols @@ -0,0 +1,68 @@ +=== /mod2.ts === +import { Cls } from "./main"; +>Cls : Symbol(Cls, Decl(mod2.ts, 0, 8)) + +import "./mod1"; + +export const cls = Cls; +>cls : Symbol(cls, Decl(mod2.ts, 3, 12)) +>Cls : Symbol(Cls, Decl(mod2.ts, 0, 8)) + +export const foo = new Cls().foo(); +>foo : Symbol(foo, Decl(mod2.ts, 4, 12)) +>new Cls().foo : Symbol(Cls.foo, Decl(mod1.ts, 6, 19)) +>Cls : Symbol(Cls, Decl(mod2.ts, 0, 8)) +>foo : Symbol(Cls.foo, Decl(mod1.ts, 6, 19)) + +export const bar = Cls.bar(); +>bar : Symbol(bar, Decl(mod2.ts, 5, 12)) +>Cls.bar : Symbol(Cls.bar, Decl(mod1.ts, 9, 19)) +>Cls : Symbol(Cls, Decl(mod2.ts, 0, 8)) +>bar : Symbol(Cls.bar, Decl(mod1.ts, 9, 19)) + +=== /types/lib/index.d.ts === + + +interface Lib { x } +>Lib : Symbol(Lib, Decl(index.d.ts, 0, 0)) +>x : Symbol(Lib.x, Decl(index.d.ts, 2, 15)) + +=== /main.ts === +export class Cls { +>Cls : Symbol(Cls, Decl(main.ts, 0, 0), Decl(mod1.ts, 5, 25), Decl(mod1.ts, 8, 5)) + + x +>x : Symbol(Cls.x, Decl(main.ts, 0, 18)) +} + +=== /mod1.ts === +/// + +import {Cls} from "./main"; +>Cls : Symbol(Cls, Decl(mod1.ts, 2, 8)) + +Cls.prototype.foo = function() { return undefined; } +>Cls.prototype.foo : Symbol(Cls.foo, Decl(mod1.ts, 6, 19)) +>Cls.prototype : Symbol(Cls.prototype) +>Cls : Symbol(Cls, Decl(mod1.ts, 2, 8)) +>prototype : Symbol(Cls.prototype) +>foo : Symbol(Cls.foo, Decl(mod1.ts, 6, 19)) +>undefined : Symbol(undefined) + +declare module "./main" { + interface Cls { +>Cls : Symbol(Cls, Decl(main.ts, 0, 0), Decl(mod1.ts, 5, 25), Decl(mod1.ts, 8, 5)) + + foo(): Lib; +>foo : Symbol(Cls.foo, Decl(mod1.ts, 6, 19)) +>Lib : Symbol(Lib, Decl(index.d.ts, 0, 0)) + } + namespace Cls { +>Cls : Symbol(Cls, Decl(main.ts, 0, 0), Decl(mod1.ts, 5, 25), Decl(mod1.ts, 8, 5)) + + function bar(): Lib; +>bar : Symbol(bar, Decl(mod1.ts, 9, 19)) +>Lib : Symbol(Lib, Decl(index.d.ts, 0, 0)) + } +} + diff --git a/tests/baselines/reference/typeReferenceDirectives12.types b/tests/baselines/reference/typeReferenceDirectives12.types new file mode 100644 index 00000000000..bd429b91f1c --- /dev/null +++ b/tests/baselines/reference/typeReferenceDirectives12.types @@ -0,0 +1,73 @@ +=== /mod2.ts === +import { Cls } from "./main"; +>Cls : typeof Cls + +import "./mod1"; + +export const cls = Cls; +>cls : typeof Cls +>Cls : typeof Cls + +export const foo = new Cls().foo(); +>foo : Lib +>new Cls().foo() : Lib +>new Cls().foo : () => Lib +>new Cls() : Cls +>Cls : typeof Cls +>foo : () => Lib + +export const bar = Cls.bar(); +>bar : Lib +>Cls.bar() : Lib +>Cls.bar : () => Lib +>Cls : typeof Cls +>bar : () => Lib + +=== /types/lib/index.d.ts === + + +interface Lib { x } +>Lib : Lib +>x : any + +=== /main.ts === +export class Cls { +>Cls : Cls + + x +>x : any +} + +=== /mod1.ts === +/// + +import {Cls} from "./main"; +>Cls : typeof Cls + +Cls.prototype.foo = function() { return undefined; } +>Cls.prototype.foo = function() { return undefined; } : () => any +>Cls.prototype.foo : () => Lib +>Cls.prototype : Cls +>Cls : typeof Cls +>prototype : Cls +>foo : () => Lib +>function() { return undefined; } : () => any +>undefined : undefined + +declare module "./main" { + interface Cls { +>Cls : Cls + + foo(): Lib; +>foo : () => Lib +>Lib : Lib + } + namespace Cls { +>Cls : typeof Cls + + function bar(): Lib; +>bar : () => Lib +>Lib : Lib + } +} +