From 454cdb8279e875a425252b8caf2ef1dadc1e936b Mon Sep 17 00:00:00 2001 From: Wesley Wigham Date: Wed, 26 Feb 2020 08:48:18 -0800 Subject: [PATCH 1/9] Retain undefined initializations (#36806) * Emit an export assignment even when the initializer is elided * User a void 0; and elide assignments for enum/namespace-sourced exported variables * HAHA, SIMPLIFY GREATLY --- src/compiler/transformers/module/module.ts | 5 +-- .../reference/aliasUsedAsNameValue.js | 1 + ...classMemberInitializerWithLamdaScoping4.js | 1 + .../commentsBeforeVariableStatement1.js | 2 + ...tExternalModuleWithSingleExportedModule.js | 1 + ...lFileExportAssignmentOfGenericInterface.js | 1 + .../reference/declFileExportImportChain.js | 1 + .../reference/declFileExportImportChain2.js | 1 + .../reference/declFileForExportedImport.js | 1 + .../reference/declFileGenericType.js | 1 + .../reference/decoratorOnImportEquals2.js | 1 + ...destructuringAssignmentWithExportedName.js | 1 + .../errorForConflictingExportEqualsValue.js | 1 + ...ssPropertyChecksWithNestedIntersections.js | 1 + .../exportNonInitializedVariablesAMD.js | 6 +++ .../exportNonInitializedVariablesCommonJS.js | 6 +++ .../exportNonInitializedVariablesUMD.js | 6 +++ .../reference/exportStarForValues5.js | 1 + tests/baselines/reference/giant.js | 1 + tests/baselines/reference/importDecl.js | 3 ++ .../importDeclarationUsedAsTypeQuery.js | 1 + ...InterfaceInsideTopLevelModuleWithExport.js | 1 + ...erfaceInsideTopLevelModuleWithoutExport.js | 1 + ...sideLocalModuleWithoutExportAccessError.js | 1 + ...zedModuleInsideTopLevelModuleWithExport.js | 1 + ...ModuleInsideTopLevelModuleWithoutExport.js | 1 + .../isolatedModulesSpecifiedModule.js | 1 + .../isolatedModulesUnspecifiedModule.js | 1 + .../moduleAliasAsFunctionArgument.js | 1 + tests/baselines/reference/nodeResolution4.js | 2 + ...thMappingBasedModuleResolution7_classic.js | 1 + .../pathMappingBasedModuleResolution7_node.js | 1 + .../reference/privacyCheckTypeOfFunction.js | 1 + ...pLevelInternalReferenceImportWithExport.js | 4 ++ ...velInternalReferenceImportWithoutExport.js | 4 ++ tests/baselines/reference/privacyVar.js | 2 + .../baselines/reference/privacyVarDeclFile.js | 3 ++ .../declarationsCascadingImports/amd/m4.js | 1 + .../declarationsCascadingImports/node/m4.js | 1 + .../declarationsGlobalImport/amd/glo_m4.js | 1 + .../declarationsGlobalImport/node/glo_m4.js | 1 + .../amd/private_m4.js | 1 + .../node/private_m4.js | 1 + .../amd/fncOnly_m4.js | 1 + .../node/fncOnly_m4.js | 1 + .../amd/m4.js | 1 + .../node/m4.js | 1 + .../declarationsMultipleTimesImport/amd/m4.js | 1 + .../node/m4.js | 1 + .../amd/m4.js | 1 + .../node/m4.js | 1 + .../declarationsSimpleImport/amd/m4.js | 1 + .../declarationsSimpleImport/node/m4.js | 1 + .../protoAsIndexInIndexExpression.js | 1 + ...siveExportAssignmentAndFindAliasedType1.js | 1 + ...siveExportAssignmentAndFindAliasedType2.js | 1 + ...siveExportAssignmentAndFindAliasedType3.js | 1 + ...siveExportAssignmentAndFindAliasedType4.js | 1 + ...siveExportAssignmentAndFindAliasedType5.js | 1 + ...siveExportAssignmentAndFindAliasedType6.js | 1 + ...siveExportAssignmentAndFindAliasedType7.js | 1 + .../spellingSuggestionLeadingUnderscores01.js | 2 + .../baselines/reference/topLevelFileModule.js | 1 + ...elf-if-'--isolatedModules'-is-specified.js | 10 ++++- ...should-be-up-to-date-with-deleted-files.js | 10 ++++- ...-be-up-to-date-with-newly-created-files.js | 10 ++++- ...-to-date-with-the-reference-map-changes.js | 11 +++++- ...les-referencing-it-if-its-shape-changed.js | 11 +++++- ...should-detect-changes-in-non-root-files.js | 11 +++++- ...ould-return-cascaded-affected-file-list.js | 37 +++++++++++++++++-- .../reference/typeGuardsInExternalModule.js | 1 + .../reference/typeReferenceDirectives7.js | 1 + .../reference/typeofANonExportedType.js | 17 +++++++++ .../reference/typeofAnExportedType.js | 17 +++++++++ tests/baselines/reference/umd-errors.js | 2 + .../reference/unusedVariablesinModules1.js | 1 + tests/baselines/reference/withExportDecl.js | 6 ++- 77 files changed, 226 insertions(+), 15 deletions(-) diff --git a/src/compiler/transformers/module/module.ts b/src/compiler/transformers/module/module.ts index 895be21f988..62cbb4b6207 100644 --- a/src/compiler/transformers/module/module.ts +++ b/src/compiler/transformers/module/module.ts @@ -1180,7 +1180,6 @@ namespace ts { let modifiers: NodeArray | undefined; // If we're exporting these variables, then these just become assignments to 'exports.x'. - // We only want to emit assignments for variables with initializers. for (const variable of node.declarationList.declarations) { if (isIdentifier(variable.name) && isLocalName(variable.name)) { if (!modifiers) { @@ -1189,7 +1188,7 @@ namespace ts { variables = append(variables, variable); } - else if (variable.initializer) { + else { expressions = append(expressions, transformInitializedVariable(variable)); } } @@ -1259,7 +1258,7 @@ namespace ts { ), /*location*/ node.name ), - visitNode(node.initializer, moduleExpressionElementVisitor) + node.initializer ? visitNode(node.initializer, moduleExpressionElementVisitor) : createVoidZero() ); } } diff --git a/tests/baselines/reference/aliasUsedAsNameValue.js b/tests/baselines/reference/aliasUsedAsNameValue.js index 168567eb80f..0f23419a930 100644 --- a/tests/baselines/reference/aliasUsedAsNameValue.js +++ b/tests/baselines/reference/aliasUsedAsNameValue.js @@ -21,6 +21,7 @@ export var a = function () { //// [aliasUsedAsNameValue_0.js] "use strict"; exports.__esModule = true; +exports.id = void 0; //// [aliasUsedAsNameValue_1.js] "use strict"; exports.__esModule = true; diff --git a/tests/baselines/reference/classMemberInitializerWithLamdaScoping4.js b/tests/baselines/reference/classMemberInitializerWithLamdaScoping4.js index a0aa11d30d6..721e1b42eb8 100644 --- a/tests/baselines/reference/classMemberInitializerWithLamdaScoping4.js +++ b/tests/baselines/reference/classMemberInitializerWithLamdaScoping4.js @@ -18,6 +18,7 @@ export class Test1 { //// [classMemberInitializerWithLamdaScoping3_0.js] "use strict"; exports.__esModule = true; +exports.field1 = void 0; //// [classMemberInitializerWithLamdaScoping3_1.js] "use strict"; exports.__esModule = true; diff --git a/tests/baselines/reference/commentsBeforeVariableStatement1.js b/tests/baselines/reference/commentsBeforeVariableStatement1.js index 9a06a3e7c22..f0d6b3ad3ae 100644 --- a/tests/baselines/reference/commentsBeforeVariableStatement1.js +++ b/tests/baselines/reference/commentsBeforeVariableStatement1.js @@ -7,4 +7,6 @@ export var b: number; define(["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; + /** b's comment*/ + exports.b = void 0; }); diff --git a/tests/baselines/reference/declFileAmbientExternalModuleWithSingleExportedModule.js b/tests/baselines/reference/declFileAmbientExternalModuleWithSingleExportedModule.js index 627a1865d8f..d31237753aa 100644 --- a/tests/baselines/reference/declFileAmbientExternalModuleWithSingleExportedModule.js +++ b/tests/baselines/reference/declFileAmbientExternalModuleWithSingleExportedModule.js @@ -21,6 +21,7 @@ export var x: SubModule.m.m3.c; //// [declFileAmbientExternalModuleWithSingleExportedModule_1.js] "use strict"; exports.__esModule = true; +exports.x = void 0; //// [declFileAmbientExternalModuleWithSingleExportedModule_0.d.ts] diff --git a/tests/baselines/reference/declFileExportAssignmentOfGenericInterface.js b/tests/baselines/reference/declFileExportAssignmentOfGenericInterface.js index cefff0be4ea..d1a56d4a5f9 100644 --- a/tests/baselines/reference/declFileExportAssignmentOfGenericInterface.js +++ b/tests/baselines/reference/declFileExportAssignmentOfGenericInterface.js @@ -20,6 +20,7 @@ define(["require", "exports"], function (require, exports) { define(["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; + exports.x = void 0; exports.x.a; }); diff --git a/tests/baselines/reference/declFileExportImportChain.js b/tests/baselines/reference/declFileExportImportChain.js index 8a6b297f81d..238d40c23a4 100644 --- a/tests/baselines/reference/declFileExportImportChain.js +++ b/tests/baselines/reference/declFileExportImportChain.js @@ -61,6 +61,7 @@ define(["require", "exports", "declFileExportImportChain_b1"], function (require define(["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; + exports.x = void 0; }); diff --git a/tests/baselines/reference/declFileExportImportChain2.js b/tests/baselines/reference/declFileExportImportChain2.js index 684ac2a1dfb..c2c9ffe6789 100644 --- a/tests/baselines/reference/declFileExportImportChain2.js +++ b/tests/baselines/reference/declFileExportImportChain2.js @@ -52,6 +52,7 @@ define(["require", "exports", "declFileExportImportChain2_b"], function (require define(["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; + exports.x = void 0; }); diff --git a/tests/baselines/reference/declFileForExportedImport.js b/tests/baselines/reference/declFileForExportedImport.js index 809f01878d4..42dfc2fa8fe 100644 --- a/tests/baselines/reference/declFileForExportedImport.js +++ b/tests/baselines/reference/declFileForExportedImport.js @@ -14,6 +14,7 @@ var z = b.x; //// [declFileForExportedImport_0.js] "use strict"; exports.__esModule = true; +exports.x = void 0; //// [declFileForExportedImport_1.js] "use strict"; exports.__esModule = true; diff --git a/tests/baselines/reference/declFileGenericType.js b/tests/baselines/reference/declFileGenericType.js index c95fc26d318..2f7be9484b7 100644 --- a/tests/baselines/reference/declFileGenericType.js +++ b/tests/baselines/reference/declFileGenericType.js @@ -89,6 +89,7 @@ var C; }()); C.D = D; })(C = exports.C || (exports.C = {})); +exports.a = void 0; exports.b = C.F; exports.c = C.F2; exports.d = C.F3; diff --git a/tests/baselines/reference/decoratorOnImportEquals2.js b/tests/baselines/reference/decoratorOnImportEquals2.js index aa8273699e3..78b352959c2 100644 --- a/tests/baselines/reference/decoratorOnImportEquals2.js +++ b/tests/baselines/reference/decoratorOnImportEquals2.js @@ -12,6 +12,7 @@ declare function dec(target: T): T; //// [decoratorOnImportEquals2_0.js] "use strict"; exports.__esModule = true; +exports.X = void 0; //// [decoratorOnImportEquals2_1.js] "use strict"; exports.__esModule = true; diff --git a/tests/baselines/reference/destructuringAssignmentWithExportedName.js b/tests/baselines/reference/destructuringAssignmentWithExportedName.js index 4dc60ecff77..9ebc9073a77 100644 --- a/tests/baselines/reference/destructuringAssignmentWithExportedName.js +++ b/tests/baselines/reference/destructuringAssignmentWithExportedName.js @@ -29,6 +29,7 @@ export { exportedFoo as foo, nonexportedFoo as nfoo }; "use strict"; var _a, _b, _c, _d, _e; Object.defineProperty(exports, "__esModule", { value: true }); +exports.exportedFoo = void 0; exports.foo = exports.exportedFoo; let nonexportedFoo; exports.nonexportedFoo = nonexportedFoo; diff --git a/tests/baselines/reference/errorForConflictingExportEqualsValue.js b/tests/baselines/reference/errorForConflictingExportEqualsValue.js index 65adec35902..9d5514422c8 100644 --- a/tests/baselines/reference/errorForConflictingExportEqualsValue.js +++ b/tests/baselines/reference/errorForConflictingExportEqualsValue.js @@ -6,5 +6,6 @@ import("./a"); //// [a.js] "use strict"; +exports.x = void 0; Promise.resolve().then(function () { return require("./a"); }); module.exports = exports.x; diff --git a/tests/baselines/reference/excessPropertyChecksWithNestedIntersections.js b/tests/baselines/reference/excessPropertyChecksWithNestedIntersections.js index e242825b852..5f4f49217a8 100644 --- a/tests/baselines/reference/excessPropertyChecksWithNestedIntersections.js +++ b/tests/baselines/reference/excessPropertyChecksWithNestedIntersections.js @@ -81,6 +81,7 @@ var c = { a: { x: 'hello', y: 2 } }; // error - y does not exist in type A var d = { a: { x: 'hello' }, c: 5 }; // ok var e = { a: { x: 2 }, c: 5 }; // error - types of property x are incompatible var f = { a: { x: 'hello', y: 2 }, c: 5 }; // error - y does not exist in type A +exports.obj = void 0; exports.photo = { id: 1, url: '', diff --git a/tests/baselines/reference/exportNonInitializedVariablesAMD.js b/tests/baselines/reference/exportNonInitializedVariablesAMD.js index 24ecd232495..c22b8d5a458 100644 --- a/tests/baselines/reference/exportNonInitializedVariablesAMD.js +++ b/tests/baselines/reference/exportNonInitializedVariablesAMD.js @@ -40,11 +40,17 @@ define(["require", "exports"], function (require, exports) { var ; let; var ; + exports.a = void 0; + exports.b = void 0; + exports.c = void 0; + exports.d = void 0; var A = /** @class */ (function () { function A() { } return A; }()); + exports.e = void 0; + exports.f = void 0; var B; (function (B) { B.a = 1, B.c = 2; diff --git a/tests/baselines/reference/exportNonInitializedVariablesCommonJS.js b/tests/baselines/reference/exportNonInitializedVariablesCommonJS.js index 8b4475e4bf9..bfa215c0629 100644 --- a/tests/baselines/reference/exportNonInitializedVariablesCommonJS.js +++ b/tests/baselines/reference/exportNonInitializedVariablesCommonJS.js @@ -39,11 +39,17 @@ exports.__esModule = true; var ; let; var ; +exports.a = void 0; +exports.b = void 0; +exports.c = void 0; +exports.d = void 0; var A = /** @class */ (function () { function A() { } return A; }()); +exports.e = void 0; +exports.f = void 0; var B; (function (B) { B.a = 1, B.c = 2; diff --git a/tests/baselines/reference/exportNonInitializedVariablesUMD.js b/tests/baselines/reference/exportNonInitializedVariablesUMD.js index bbea71b763d..f2665d67b10 100644 --- a/tests/baselines/reference/exportNonInitializedVariablesUMD.js +++ b/tests/baselines/reference/exportNonInitializedVariablesUMD.js @@ -48,11 +48,17 @@ export let h1: D = new D; var ; let; var ; + exports.a = void 0; + exports.b = void 0; + exports.c = void 0; + exports.d = void 0; var A = /** @class */ (function () { function A() { } return A; }()); + exports.e = void 0; + exports.f = void 0; var B; (function (B) { B.a = 1, B.c = 2; diff --git a/tests/baselines/reference/exportStarForValues5.js b/tests/baselines/reference/exportStarForValues5.js index 812058ebd06..53e7c68907a 100644 --- a/tests/baselines/reference/exportStarForValues5.js +++ b/tests/baselines/reference/exportStarForValues5.js @@ -16,4 +16,5 @@ define(["require", "exports"], function (require, exports) { define(["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; + exports.x = void 0; }); diff --git a/tests/baselines/reference/giant.js b/tests/baselines/reference/giant.js index 9adf046d8cf..cff0440a5f5 100644 --- a/tests/baselines/reference/giant.js +++ b/tests/baselines/reference/giant.js @@ -901,6 +901,7 @@ define(["require", "exports"], function (require, exports) { })(eM = M_1.eM || (M_1.eM = {})); ; })(M || (M = {})); + exports.eV = void 0; function eF() { } exports.eF = eF; ; diff --git a/tests/baselines/reference/importDecl.js b/tests/baselines/reference/importDecl.js index 2eb9208910a..3fa11f81aba 100644 --- a/tests/baselines/reference/importDecl.js +++ b/tests/baselines/reference/importDecl.js @@ -90,6 +90,7 @@ var d = /** @class */ (function () { return d; }()); exports.d = d; +exports.x = void 0; function foo() { return null; } exports.foo = foo; //// [importDecl_require1.js] @@ -113,6 +114,7 @@ var d = /** @class */ (function () { return d; }()); exports.d = d; +exports.x = void 0; function foo() { return null; } exports.foo = foo; //// [importDecl_require3.js] @@ -124,6 +126,7 @@ var d = /** @class */ (function () { return d; }()); exports.d = d; +exports.x = void 0; function foo() { return null; } exports.foo = foo; //// [importDecl_require4.js] diff --git a/tests/baselines/reference/importDeclarationUsedAsTypeQuery.js b/tests/baselines/reference/importDeclarationUsedAsTypeQuery.js index a6431f6a2c3..bbcca5d2024 100644 --- a/tests/baselines/reference/importDeclarationUsedAsTypeQuery.js +++ b/tests/baselines/reference/importDeclarationUsedAsTypeQuery.js @@ -23,6 +23,7 @@ exports.B = B; //// [importDeclarationUsedAsTypeQuery_1.js] "use strict"; exports.__esModule = true; +exports.x = void 0; //// [importDeclarationUsedAsTypeQuery_require.d.ts] diff --git a/tests/baselines/reference/internalAliasInterfaceInsideTopLevelModuleWithExport.js b/tests/baselines/reference/internalAliasInterfaceInsideTopLevelModuleWithExport.js index 4434670366c..5202f89d4d9 100644 --- a/tests/baselines/reference/internalAliasInterfaceInsideTopLevelModuleWithExport.js +++ b/tests/baselines/reference/internalAliasInterfaceInsideTopLevelModuleWithExport.js @@ -11,6 +11,7 @@ export var x: b; //// [internalAliasInterfaceInsideTopLevelModuleWithExport.js] "use strict"; exports.__esModule = true; +exports.x = void 0; //// [internalAliasInterfaceInsideTopLevelModuleWithExport.d.ts] diff --git a/tests/baselines/reference/internalAliasInterfaceInsideTopLevelModuleWithoutExport.js b/tests/baselines/reference/internalAliasInterfaceInsideTopLevelModuleWithoutExport.js index 5645c76ed2a..e6bdc2d2737 100644 --- a/tests/baselines/reference/internalAliasInterfaceInsideTopLevelModuleWithoutExport.js +++ b/tests/baselines/reference/internalAliasInterfaceInsideTopLevelModuleWithoutExport.js @@ -12,6 +12,7 @@ export var x: b; define(["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; + exports.x = void 0; }); diff --git a/tests/baselines/reference/internalAliasUninitializedModuleInsideLocalModuleWithoutExportAccessError.js b/tests/baselines/reference/internalAliasUninitializedModuleInsideLocalModuleWithoutExportAccessError.js index a6b4f83de8e..37b2fca2de8 100644 --- a/tests/baselines/reference/internalAliasUninitializedModuleInsideLocalModuleWithoutExportAccessError.js +++ b/tests/baselines/reference/internalAliasUninitializedModuleInsideLocalModuleWithoutExportAccessError.js @@ -24,4 +24,5 @@ define(["require", "exports"], function (require, exports) { (function (c) { c.x.foo(); })(c = exports.c || (exports.c = {})); + exports.z = void 0; }); diff --git a/tests/baselines/reference/internalAliasUninitializedModuleInsideTopLevelModuleWithExport.js b/tests/baselines/reference/internalAliasUninitializedModuleInsideTopLevelModuleWithExport.js index eccbd9a45bd..523f4f07ff3 100644 --- a/tests/baselines/reference/internalAliasUninitializedModuleInsideTopLevelModuleWithExport.js +++ b/tests/baselines/reference/internalAliasUninitializedModuleInsideTopLevelModuleWithExport.js @@ -16,6 +16,7 @@ x.foo(); define(["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; + exports.x = void 0; exports.x.foo(); }); diff --git a/tests/baselines/reference/internalAliasUninitializedModuleInsideTopLevelModuleWithoutExport.js b/tests/baselines/reference/internalAliasUninitializedModuleInsideTopLevelModuleWithoutExport.js index 27de6bbfd98..3004c9c0e9b 100644 --- a/tests/baselines/reference/internalAliasUninitializedModuleInsideTopLevelModuleWithoutExport.js +++ b/tests/baselines/reference/internalAliasUninitializedModuleInsideTopLevelModuleWithoutExport.js @@ -15,6 +15,7 @@ x.foo(); //// [internalAliasUninitializedModuleInsideTopLevelModuleWithoutExport.js] "use strict"; exports.__esModule = true; +exports.x = void 0; exports.x.foo(); diff --git a/tests/baselines/reference/isolatedModulesSpecifiedModule.js b/tests/baselines/reference/isolatedModulesSpecifiedModule.js index 895c47e2504..540dd535b77 100644 --- a/tests/baselines/reference/isolatedModulesSpecifiedModule.js +++ b/tests/baselines/reference/isolatedModulesSpecifiedModule.js @@ -4,3 +4,4 @@ export var x; //// [file1.js] "use strict"; exports.__esModule = true; +exports.x = void 0; diff --git a/tests/baselines/reference/isolatedModulesUnspecifiedModule.js b/tests/baselines/reference/isolatedModulesUnspecifiedModule.js index 895c47e2504..540dd535b77 100644 --- a/tests/baselines/reference/isolatedModulesUnspecifiedModule.js +++ b/tests/baselines/reference/isolatedModulesUnspecifiedModule.js @@ -4,3 +4,4 @@ export var x; //// [file1.js] "use strict"; exports.__esModule = true; +exports.x = void 0; diff --git a/tests/baselines/reference/moduleAliasAsFunctionArgument.js b/tests/baselines/reference/moduleAliasAsFunctionArgument.js index 16eb962a863..0630c1011cb 100644 --- a/tests/baselines/reference/moduleAliasAsFunctionArgument.js +++ b/tests/baselines/reference/moduleAliasAsFunctionArgument.js @@ -18,6 +18,7 @@ fn(a); // Error: property 'x' is missing from 'a' define(["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; + exports.x = void 0; }); //// [moduleAliasAsFunctionArgument_1.js] define(["require", "exports", "moduleAliasAsFunctionArgument_0"], function (require, exports, a) { diff --git a/tests/baselines/reference/nodeResolution4.js b/tests/baselines/reference/nodeResolution4.js index 3285f3b8e20..1613cdfb213 100644 --- a/tests/baselines/reference/nodeResolution4.js +++ b/tests/baselines/reference/nodeResolution4.js @@ -15,6 +15,8 @@ var x = 1; //// [a.js] "use strict"; exports.__esModule = true; +/// +exports.y = void 0; //// [b.js] "use strict"; exports.__esModule = true; diff --git a/tests/baselines/reference/pathMappingBasedModuleResolution7_classic.js b/tests/baselines/reference/pathMappingBasedModuleResolution7_classic.js index 55aca054e82..aa9d4d7db9e 100644 --- a/tests/baselines/reference/pathMappingBasedModuleResolution7_classic.js +++ b/tests/baselines/reference/pathMappingBasedModuleResolution7_classic.js @@ -32,6 +32,7 @@ export let y: number; define(["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; + exports.b = void 0; }); //// [file2.js] define(["require", "exports", "module1", "templates/module2", "../file3"], function (require, exports, module1_1, module2_1, file3_1) { diff --git a/tests/baselines/reference/pathMappingBasedModuleResolution7_node.js b/tests/baselines/reference/pathMappingBasedModuleResolution7_node.js index 303b98f4d83..94c1c182007 100644 --- a/tests/baselines/reference/pathMappingBasedModuleResolution7_node.js +++ b/tests/baselines/reference/pathMappingBasedModuleResolution7_node.js @@ -31,6 +31,7 @@ export let y: number; //// [module2.js] "use strict"; exports.__esModule = true; +exports.b = void 0; //// [file2.js] "use strict"; exports.__esModule = true; diff --git a/tests/baselines/reference/privacyCheckTypeOfFunction.js b/tests/baselines/reference/privacyCheckTypeOfFunction.js index ca9878c6727..ce86f7bca35 100644 --- a/tests/baselines/reference/privacyCheckTypeOfFunction.js +++ b/tests/baselines/reference/privacyCheckTypeOfFunction.js @@ -10,6 +10,7 @@ export var b = foo; exports.__esModule = true; function foo() { } +exports.x = void 0; exports.b = foo; diff --git a/tests/baselines/reference/privacyTopLevelInternalReferenceImportWithExport.js b/tests/baselines/reference/privacyTopLevelInternalReferenceImportWithExport.js index b2da49d083e..60dcb9dfaa5 100644 --- a/tests/baselines/reference/privacyTopLevelInternalReferenceImportWithExport.js +++ b/tests/baselines/reference/privacyTopLevelInternalReferenceImportWithExport.js @@ -177,9 +177,11 @@ define(["require", "exports"], function (require, exports) { var privateUse_im_public_v_private = exports.im_public_v_private; exports.publicUse_im_public_v_private = exports.im_public_v_private; var privateUse_im_public_i_private; + exports.publicUse_im_public_i_private = void 0; var privateUse_im_public_mi_private = new exports.im_public_mi_private.c(); exports.publicUse_im_public_mi_private = new exports.im_public_mi_private.c(); var privateUse_im_public_mu_private; + exports.publicUse_im_public_mu_private = void 0; // No Privacy errors - importing public elements exports.im_public_c_public = m_public.c_public; exports.im_public_e_public = m_public.e_public; @@ -196,9 +198,11 @@ define(["require", "exports"], function (require, exports) { var privateUse_im_public_v_public = exports.im_public_v_public; exports.publicUse_im_public_v_public = exports.im_public_v_public; var privateUse_im_public_i_public; + exports.publicUse_im_public_i_public = void 0; var privateUse_im_public_mi_public = new exports.im_public_mi_public.c(); exports.publicUse_im_public_mi_public = new exports.im_public_mi_public.c(); var privateUse_im_public_mu_public; + exports.publicUse_im_public_mu_public = void 0; }); diff --git a/tests/baselines/reference/privacyTopLevelInternalReferenceImportWithoutExport.js b/tests/baselines/reference/privacyTopLevelInternalReferenceImportWithoutExport.js index eefb1a7627f..e2cd1e4bb79 100644 --- a/tests/baselines/reference/privacyTopLevelInternalReferenceImportWithoutExport.js +++ b/tests/baselines/reference/privacyTopLevelInternalReferenceImportWithoutExport.js @@ -177,9 +177,11 @@ define(["require", "exports"], function (require, exports) { var privateUse_im_private_v_private = im_private_v_private; exports.publicUse_im_private_v_private = im_private_v_private; var privateUse_im_private_i_private; + exports.publicUse_im_private_i_private = void 0; var privateUse_im_private_mi_private = new im_private_mi_private.c(); exports.publicUse_im_private_mi_private = new im_private_mi_private.c(); var privateUse_im_private_mu_private; + exports.publicUse_im_private_mu_private = void 0; // No Privacy errors - importing public elements var im_private_c_public = m_public.c_public; var im_private_e_public = m_public.e_public; @@ -196,9 +198,11 @@ define(["require", "exports"], function (require, exports) { var privateUse_im_private_v_public = im_private_v_public; exports.publicUse_im_private_v_public = im_private_v_public; var privateUse_im_private_i_public; + exports.publicUse_im_private_i_public = void 0; var privateUse_im_private_mi_public = new im_private_mi_public.c(); exports.publicUse_im_private_mi_public = new im_private_mi_public.c(); var privateUse_im_private_mu_public; + exports.publicUse_im_private_mu_public = void 0; }); diff --git a/tests/baselines/reference/privacyVar.js b/tests/baselines/reference/privacyVar.js index ccaf7e1f1b7..9a08894cefc 100644 --- a/tests/baselines/reference/privacyVar.js +++ b/tests/baselines/reference/privacyVar.js @@ -324,7 +324,9 @@ var glo_C4_public = /** @class */ (function () { return glo_C4_public; }()); var glo_v1_private; +exports.glo_v2_public = void 0; var glo_v3_private; +exports.glo_v4_public = void 0; // error var glo_v11_private = new glo_C1_public(); exports.glo_v12_public = new glo_C1_public(); var glo_v13_private = new glo_C2_private(); diff --git a/tests/baselines/reference/privacyVarDeclFile.js b/tests/baselines/reference/privacyVarDeclFile.js index 76d69b2a2ef..6899d04f2a7 100644 --- a/tests/baselines/reference/privacyVarDeclFile.js +++ b/tests/baselines/reference/privacyVarDeclFile.js @@ -460,6 +460,8 @@ var privateClassWithWithPublicPropertyTypes = /** @class */ (function () { } return privateClassWithWithPublicPropertyTypes; }()); +exports.publicVarWithPrivatePropertyTypes = void 0; // Error +exports.publicVarWithPublicPropertyTypes = void 0; var privateVarWithPrivatePropertyTypes; var privateVarWithPublicPropertyTypes; var publicClassWithPrivateModulePropertyTypes = /** @class */ (function () { @@ -468,6 +470,7 @@ var publicClassWithPrivateModulePropertyTypes = /** @class */ (function () { return publicClassWithPrivateModulePropertyTypes; }()); exports.publicClassWithPrivateModulePropertyTypes = publicClassWithPrivateModulePropertyTypes; +exports.publicVarWithPrivateModulePropertyTypes = void 0; // Error var privateClassWithPrivateModulePropertyTypes = /** @class */ (function () { function privateClassWithPrivateModulePropertyTypes() { } diff --git a/tests/baselines/reference/project/declarationsCascadingImports/amd/m4.js b/tests/baselines/reference/project/declarationsCascadingImports/amd/m4.js index 24e2e443bfe..eaaad1d5f7c 100644 --- a/tests/baselines/reference/project/declarationsCascadingImports/amd/m4.js +++ b/tests/baselines/reference/project/declarationsCascadingImports/amd/m4.js @@ -8,6 +8,7 @@ define(["require", "exports"], function (require, exports) { }()); exports.d = d; ; + exports.x = void 0; function foo() { return new d(); } diff --git a/tests/baselines/reference/project/declarationsCascadingImports/node/m4.js b/tests/baselines/reference/project/declarationsCascadingImports/node/m4.js index 7a8d072b08d..fb8354c309b 100644 --- a/tests/baselines/reference/project/declarationsCascadingImports/node/m4.js +++ b/tests/baselines/reference/project/declarationsCascadingImports/node/m4.js @@ -7,6 +7,7 @@ var d = /** @class */ (function () { }()); exports.d = d; ; +exports.x = void 0; function foo() { return new d(); } diff --git a/tests/baselines/reference/project/declarationsGlobalImport/amd/glo_m4.js b/tests/baselines/reference/project/declarationsGlobalImport/amd/glo_m4.js index 24e2e443bfe..eaaad1d5f7c 100644 --- a/tests/baselines/reference/project/declarationsGlobalImport/amd/glo_m4.js +++ b/tests/baselines/reference/project/declarationsGlobalImport/amd/glo_m4.js @@ -8,6 +8,7 @@ define(["require", "exports"], function (require, exports) { }()); exports.d = d; ; + exports.x = void 0; function foo() { return new d(); } diff --git a/tests/baselines/reference/project/declarationsGlobalImport/node/glo_m4.js b/tests/baselines/reference/project/declarationsGlobalImport/node/glo_m4.js index 7a8d072b08d..fb8354c309b 100644 --- a/tests/baselines/reference/project/declarationsGlobalImport/node/glo_m4.js +++ b/tests/baselines/reference/project/declarationsGlobalImport/node/glo_m4.js @@ -7,6 +7,7 @@ var d = /** @class */ (function () { }()); exports.d = d; ; +exports.x = void 0; function foo() { return new d(); } diff --git a/tests/baselines/reference/project/declarationsImportedInPrivate/amd/private_m4.js b/tests/baselines/reference/project/declarationsImportedInPrivate/amd/private_m4.js index 24e2e443bfe..eaaad1d5f7c 100644 --- a/tests/baselines/reference/project/declarationsImportedInPrivate/amd/private_m4.js +++ b/tests/baselines/reference/project/declarationsImportedInPrivate/amd/private_m4.js @@ -8,6 +8,7 @@ define(["require", "exports"], function (require, exports) { }()); exports.d = d; ; + exports.x = void 0; function foo() { return new d(); } diff --git a/tests/baselines/reference/project/declarationsImportedInPrivate/node/private_m4.js b/tests/baselines/reference/project/declarationsImportedInPrivate/node/private_m4.js index 7a8d072b08d..fb8354c309b 100644 --- a/tests/baselines/reference/project/declarationsImportedInPrivate/node/private_m4.js +++ b/tests/baselines/reference/project/declarationsImportedInPrivate/node/private_m4.js @@ -7,6 +7,7 @@ var d = /** @class */ (function () { }()); exports.d = d; ; +exports.x = void 0; function foo() { return new d(); } diff --git a/tests/baselines/reference/project/declarationsImportedUseInFunction/amd/fncOnly_m4.js b/tests/baselines/reference/project/declarationsImportedUseInFunction/amd/fncOnly_m4.js index 24e2e443bfe..eaaad1d5f7c 100644 --- a/tests/baselines/reference/project/declarationsImportedUseInFunction/amd/fncOnly_m4.js +++ b/tests/baselines/reference/project/declarationsImportedUseInFunction/amd/fncOnly_m4.js @@ -8,6 +8,7 @@ define(["require", "exports"], function (require, exports) { }()); exports.d = d; ; + exports.x = void 0; function foo() { return new d(); } diff --git a/tests/baselines/reference/project/declarationsImportedUseInFunction/node/fncOnly_m4.js b/tests/baselines/reference/project/declarationsImportedUseInFunction/node/fncOnly_m4.js index 7a8d072b08d..fb8354c309b 100644 --- a/tests/baselines/reference/project/declarationsImportedUseInFunction/node/fncOnly_m4.js +++ b/tests/baselines/reference/project/declarationsImportedUseInFunction/node/fncOnly_m4.js @@ -7,6 +7,7 @@ var d = /** @class */ (function () { }()); exports.d = d; ; +exports.x = void 0; function foo() { return new d(); } diff --git a/tests/baselines/reference/project/declarationsIndirectImportShouldResultInError/amd/m4.js b/tests/baselines/reference/project/declarationsIndirectImportShouldResultInError/amd/m4.js index 24e2e443bfe..eaaad1d5f7c 100644 --- a/tests/baselines/reference/project/declarationsIndirectImportShouldResultInError/amd/m4.js +++ b/tests/baselines/reference/project/declarationsIndirectImportShouldResultInError/amd/m4.js @@ -8,6 +8,7 @@ define(["require", "exports"], function (require, exports) { }()); exports.d = d; ; + exports.x = void 0; function foo() { return new d(); } diff --git a/tests/baselines/reference/project/declarationsIndirectImportShouldResultInError/node/m4.js b/tests/baselines/reference/project/declarationsIndirectImportShouldResultInError/node/m4.js index 7a8d072b08d..fb8354c309b 100644 --- a/tests/baselines/reference/project/declarationsIndirectImportShouldResultInError/node/m4.js +++ b/tests/baselines/reference/project/declarationsIndirectImportShouldResultInError/node/m4.js @@ -7,6 +7,7 @@ var d = /** @class */ (function () { }()); exports.d = d; ; +exports.x = void 0; function foo() { return new d(); } diff --git a/tests/baselines/reference/project/declarationsMultipleTimesImport/amd/m4.js b/tests/baselines/reference/project/declarationsMultipleTimesImport/amd/m4.js index 24e2e443bfe..eaaad1d5f7c 100644 --- a/tests/baselines/reference/project/declarationsMultipleTimesImport/amd/m4.js +++ b/tests/baselines/reference/project/declarationsMultipleTimesImport/amd/m4.js @@ -8,6 +8,7 @@ define(["require", "exports"], function (require, exports) { }()); exports.d = d; ; + exports.x = void 0; function foo() { return new d(); } diff --git a/tests/baselines/reference/project/declarationsMultipleTimesImport/node/m4.js b/tests/baselines/reference/project/declarationsMultipleTimesImport/node/m4.js index 7a8d072b08d..fb8354c309b 100644 --- a/tests/baselines/reference/project/declarationsMultipleTimesImport/node/m4.js +++ b/tests/baselines/reference/project/declarationsMultipleTimesImport/node/m4.js @@ -7,6 +7,7 @@ var d = /** @class */ (function () { }()); exports.d = d; ; +exports.x = void 0; function foo() { return new d(); } diff --git a/tests/baselines/reference/project/declarationsMultipleTimesMultipleImport/amd/m4.js b/tests/baselines/reference/project/declarationsMultipleTimesMultipleImport/amd/m4.js index 24e2e443bfe..eaaad1d5f7c 100644 --- a/tests/baselines/reference/project/declarationsMultipleTimesMultipleImport/amd/m4.js +++ b/tests/baselines/reference/project/declarationsMultipleTimesMultipleImport/amd/m4.js @@ -8,6 +8,7 @@ define(["require", "exports"], function (require, exports) { }()); exports.d = d; ; + exports.x = void 0; function foo() { return new d(); } diff --git a/tests/baselines/reference/project/declarationsMultipleTimesMultipleImport/node/m4.js b/tests/baselines/reference/project/declarationsMultipleTimesMultipleImport/node/m4.js index 7a8d072b08d..fb8354c309b 100644 --- a/tests/baselines/reference/project/declarationsMultipleTimesMultipleImport/node/m4.js +++ b/tests/baselines/reference/project/declarationsMultipleTimesMultipleImport/node/m4.js @@ -7,6 +7,7 @@ var d = /** @class */ (function () { }()); exports.d = d; ; +exports.x = void 0; function foo() { return new d(); } diff --git a/tests/baselines/reference/project/declarationsSimpleImport/amd/m4.js b/tests/baselines/reference/project/declarationsSimpleImport/amd/m4.js index 24e2e443bfe..eaaad1d5f7c 100644 --- a/tests/baselines/reference/project/declarationsSimpleImport/amd/m4.js +++ b/tests/baselines/reference/project/declarationsSimpleImport/amd/m4.js @@ -8,6 +8,7 @@ define(["require", "exports"], function (require, exports) { }()); exports.d = d; ; + exports.x = void 0; function foo() { return new d(); } diff --git a/tests/baselines/reference/project/declarationsSimpleImport/node/m4.js b/tests/baselines/reference/project/declarationsSimpleImport/node/m4.js index 7a8d072b08d..fb8354c309b 100644 --- a/tests/baselines/reference/project/declarationsSimpleImport/node/m4.js +++ b/tests/baselines/reference/project/declarationsSimpleImport/node/m4.js @@ -7,6 +7,7 @@ var d = /** @class */ (function () { }()); exports.d = d; ; +exports.x = void 0; function foo() { return new d(); } diff --git a/tests/baselines/reference/protoAsIndexInIndexExpression.js b/tests/baselines/reference/protoAsIndexInIndexExpression.js index d0d2eb52f78..502033c42bb 100644 --- a/tests/baselines/reference/protoAsIndexInIndexExpression.js +++ b/tests/baselines/reference/protoAsIndexInIndexExpression.js @@ -22,6 +22,7 @@ class C { //// [protoAsIndexInIndexExpression_0.js] "use strict"; exports.__esModule = true; +exports.x = void 0; //// [protoAsIndexInIndexExpression_1.js] /// var EntityPrototype = undefined; diff --git a/tests/baselines/reference/recursiveExportAssignmentAndFindAliasedType1.js b/tests/baselines/reference/recursiveExportAssignmentAndFindAliasedType1.js index 151c719e0bd..2beadbb5933 100644 --- a/tests/baselines/reference/recursiveExportAssignmentAndFindAliasedType1.js +++ b/tests/baselines/reference/recursiveExportAssignmentAndFindAliasedType1.js @@ -30,4 +30,5 @@ define(["require", "exports"], function (require, exports) { define(["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; + exports.b = void 0; // This should result in type ClassB }); diff --git a/tests/baselines/reference/recursiveExportAssignmentAndFindAliasedType2.js b/tests/baselines/reference/recursiveExportAssignmentAndFindAliasedType2.js index 3ef3cc597f5..b64dca267e9 100644 --- a/tests/baselines/reference/recursiveExportAssignmentAndFindAliasedType2.js +++ b/tests/baselines/reference/recursiveExportAssignmentAndFindAliasedType2.js @@ -34,4 +34,5 @@ define(["require", "exports"], function (require, exports) { define(["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; + exports.b = void 0; // This should result in type ClassB }); diff --git a/tests/baselines/reference/recursiveExportAssignmentAndFindAliasedType3.js b/tests/baselines/reference/recursiveExportAssignmentAndFindAliasedType3.js index 53ad4b53464..a74c6c04ba0 100644 --- a/tests/baselines/reference/recursiveExportAssignmentAndFindAliasedType3.js +++ b/tests/baselines/reference/recursiveExportAssignmentAndFindAliasedType3.js @@ -38,4 +38,5 @@ define(["require", "exports"], function (require, exports) { define(["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; + exports.b = void 0; // This should result in type ClassB }); diff --git a/tests/baselines/reference/recursiveExportAssignmentAndFindAliasedType4.js b/tests/baselines/reference/recursiveExportAssignmentAndFindAliasedType4.js index 2ab16bea5ba..bf4e487253a 100644 --- a/tests/baselines/reference/recursiveExportAssignmentAndFindAliasedType4.js +++ b/tests/baselines/reference/recursiveExportAssignmentAndFindAliasedType4.js @@ -32,4 +32,5 @@ define(["require", "exports"], function (require, exports) { define(["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; + exports.b = void 0; // This should result in type ClassB }); diff --git a/tests/baselines/reference/recursiveExportAssignmentAndFindAliasedType5.js b/tests/baselines/reference/recursiveExportAssignmentAndFindAliasedType5.js index 2fd84905632..376ed58b588 100644 --- a/tests/baselines/reference/recursiveExportAssignmentAndFindAliasedType5.js +++ b/tests/baselines/reference/recursiveExportAssignmentAndFindAliasedType5.js @@ -41,4 +41,5 @@ define(["require", "exports"], function (require, exports) { define(["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; + exports.b = void 0; // This should result in type ClassB }); diff --git a/tests/baselines/reference/recursiveExportAssignmentAndFindAliasedType6.js b/tests/baselines/reference/recursiveExportAssignmentAndFindAliasedType6.js index 6d5cc60f5e4..6c28ccc9cb4 100644 --- a/tests/baselines/reference/recursiveExportAssignmentAndFindAliasedType6.js +++ b/tests/baselines/reference/recursiveExportAssignmentAndFindAliasedType6.js @@ -50,4 +50,5 @@ define(["require", "exports"], function (require, exports) { define(["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; + exports.b = void 0; // This should result in type ClassB }); diff --git a/tests/baselines/reference/recursiveExportAssignmentAndFindAliasedType7.js b/tests/baselines/reference/recursiveExportAssignmentAndFindAliasedType7.js index c4bc8804f60..36dd00cc36f 100644 --- a/tests/baselines/reference/recursiveExportAssignmentAndFindAliasedType7.js +++ b/tests/baselines/reference/recursiveExportAssignmentAndFindAliasedType7.js @@ -52,4 +52,5 @@ define(["require", "exports"], function (require, exports) { define(["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; + exports.b = void 0; // This should result in type ClassB }); diff --git a/tests/baselines/reference/spellingSuggestionLeadingUnderscores01.js b/tests/baselines/reference/spellingSuggestionLeadingUnderscores01.js index 6a84749b153..1abb0b71ea1 100644 --- a/tests/baselines/reference/spellingSuggestionLeadingUnderscores01.js +++ b/tests/baselines/reference/spellingSuggestionLeadingUnderscores01.js @@ -21,6 +21,8 @@ b = { "use strict"; exports.__esModule = true; exports.a.___foo; +// @filename def.ts +exports.b = void 0; exports.b = { ___foo: 100 }; diff --git a/tests/baselines/reference/topLevelFileModule.js b/tests/baselines/reference/topLevelFileModule.js index 8ff74cc89f4..83b1a338af0 100644 --- a/tests/baselines/reference/topLevelFileModule.js +++ b/tests/baselines/reference/topLevelFileModule.js @@ -15,6 +15,7 @@ var z = foo.x + fum.y; //// [foo_0.js] "use strict"; exports.__esModule = true; +exports.x = void 0; //// [foo_1.js] "use strict"; exports.__esModule = true; diff --git a/tests/baselines/reference/tscWatch/emit/emit-for-configured-projects/should-always-return-the-file-itself-if-'--isolatedModules'-is-specified.js b/tests/baselines/reference/tscWatch/emit/emit-for-configured-projects/should-always-return-the-file-itself-if-'--isolatedModules'-is-specified.js index e9c1caed5aa..3b53157eaf8 100644 --- a/tests/baselines/reference/tscWatch/emit/emit-for-configured-projects/should-always-return-the-file-itself-if-'--isolatedModules'-is-specified.js +++ b/tests/baselines/reference/tscWatch/emit/emit-for-configured-projects/should-always-return-the-file-itself-if-'--isolatedModules'-is-specified.js @@ -120,7 +120,15 @@ Change:: Change the content of moduleFile1 to `export var T: number;export funct //// [/a/b/moduleFile1.ts] export var T: number;export function Foo() { }; -//// [/a/b/moduleFile1.js] file written with same contents +//// [/a/b/moduleFile1.js] +"use strict"; +exports.__esModule = true; +exports.T = void 0; +function Foo() { } +exports.Foo = Foo; +; + + Output:: >> Screen clear diff --git a/tests/baselines/reference/tscWatch/emit/emit-for-configured-projects/should-be-up-to-date-with-deleted-files.js b/tests/baselines/reference/tscWatch/emit/emit-for-configured-projects/should-be-up-to-date-with-deleted-files.js index d924bddf55c..beca4999867 100644 --- a/tests/baselines/reference/tscWatch/emit/emit-for-configured-projects/should-be-up-to-date-with-deleted-files.js +++ b/tests/baselines/reference/tscWatch/emit/emit-for-configured-projects/should-be-up-to-date-with-deleted-files.js @@ -118,7 +118,15 @@ Change:: change moduleFile1 shape and delete file1Consumer2 //// [/a/b/moduleFile1.ts] export var T: number;export function Foo() { }; -//// [/a/b/moduleFile1.js] file written with same contents +//// [/a/b/moduleFile1.js] +"use strict"; +exports.__esModule = true; +exports.T = void 0; +function Foo() { } +exports.Foo = Foo; +; + + //// [/a/b/file1Consumer1.js] file written with same contents //// [/a/b/file1Consumer2.ts] deleted diff --git a/tests/baselines/reference/tscWatch/emit/emit-for-configured-projects/should-be-up-to-date-with-newly-created-files.js b/tests/baselines/reference/tscWatch/emit/emit-for-configured-projects/should-be-up-to-date-with-newly-created-files.js index d764b6c3960..0cbc827fd18 100644 --- a/tests/baselines/reference/tscWatch/emit/emit-for-configured-projects/should-be-up-to-date-with-newly-created-files.js +++ b/tests/baselines/reference/tscWatch/emit/emit-for-configured-projects/should-be-up-to-date-with-newly-created-files.js @@ -118,7 +118,15 @@ Change:: change moduleFile1 shape and create file1Consumer3 //// [/a/b/moduleFile1.ts] export var T: number;export function Foo() { }; -//// [/a/b/moduleFile1.js] file written with same contents +//// [/a/b/moduleFile1.js] +"use strict"; +exports.__esModule = true; +exports.T = void 0; +function Foo() { } +exports.Foo = Foo; +; + + //// [/a/b/file1Consumer1.js] file written with same contents //// [/a/b/file1Consumer2.js] file written with same contents //// [/a/b/file1Consumer3.ts] diff --git a/tests/baselines/reference/tscWatch/emit/emit-for-configured-projects/should-be-up-to-date-with-the-reference-map-changes.js b/tests/baselines/reference/tscWatch/emit/emit-for-configured-projects/should-be-up-to-date-with-the-reference-map-changes.js index a12af63e94a..c45888616d3 100644 --- a/tests/baselines/reference/tscWatch/emit/emit-for-configured-projects/should-be-up-to-date-with-the-reference-map-changes.js +++ b/tests/baselines/reference/tscWatch/emit/emit-for-configured-projects/should-be-up-to-date-with-the-reference-map-changes.js @@ -180,7 +180,15 @@ Change:: Change the content of moduleFile1 to `export var T: number;export funct //// [/a/b/moduleFile1.ts] export var T: number;export function Foo() { }; -//// [/a/b/moduleFile1.js] file written with same contents +//// [/a/b/moduleFile1.js] +"use strict"; +exports.__esModule = true; +exports.T = void 0; +function Foo() { } +exports.Foo = Foo; +; + + //// [/a/b/file1Consumer2.js] file written with same contents Output:: @@ -374,6 +382,7 @@ export var T: number;export function Foo() { }; //// [/a/b/moduleFile1.js] "use strict"; exports.__esModule = true; +exports.T = void 0; function Foo() { } exports.Foo = Foo; ; diff --git a/tests/baselines/reference/tscWatch/emit/emit-for-configured-projects/should-contains-only-itself-if-a-module-file's-shape-didn't-change,-and-all-files-referencing-it-if-its-shape-changed.js b/tests/baselines/reference/tscWatch/emit/emit-for-configured-projects/should-contains-only-itself-if-a-module-file's-shape-didn't-change,-and-all-files-referencing-it-if-its-shape-changed.js index 96a98ca1494..77e20bfec1b 100644 --- a/tests/baselines/reference/tscWatch/emit/emit-for-configured-projects/should-contains-only-itself-if-a-module-file's-shape-didn't-change,-and-all-files-referencing-it-if-its-shape-changed.js +++ b/tests/baselines/reference/tscWatch/emit/emit-for-configured-projects/should-contains-only-itself-if-a-module-file's-shape-didn't-change,-and-all-files-referencing-it-if-its-shape-changed.js @@ -118,7 +118,15 @@ Change:: Change the content of moduleFile1 to `export var T: number;export funct //// [/a/b/moduleFile1.ts] export var T: number;export function Foo() { }; -//// [/a/b/moduleFile1.js] file written with same contents +//// [/a/b/moduleFile1.js] +"use strict"; +exports.__esModule = true; +exports.T = void 0; +function Foo() { } +exports.Foo = Foo; +; + + //// [/a/b/file1Consumer1.js] file written with same contents //// [/a/b/file1Consumer2.js] file written with same contents @@ -180,6 +188,7 @@ export var T: number;export function Foo() { console.log('hi'); }; //// [/a/b/moduleFile1.js] "use strict"; exports.__esModule = true; +exports.T = void 0; function Foo() { console.log('hi'); } exports.Foo = Foo; ; diff --git a/tests/baselines/reference/tscWatch/emit/emit-for-configured-projects/should-detect-changes-in-non-root-files.js b/tests/baselines/reference/tscWatch/emit/emit-for-configured-projects/should-detect-changes-in-non-root-files.js index b127003dbc2..2606b0f2579 100644 --- a/tests/baselines/reference/tscWatch/emit/emit-for-configured-projects/should-detect-changes-in-non-root-files.js +++ b/tests/baselines/reference/tscWatch/emit/emit-for-configured-projects/should-detect-changes-in-non-root-files.js @@ -89,7 +89,15 @@ Change:: Change the content of moduleFile1 to `export var T: number;export funct //// [/a/b/moduleFile1.ts] export var T: number;export function Foo() { }; -//// [/a/b/moduleFile1.js] file written with same contents +//// [/a/b/moduleFile1.js] +"use strict"; +exports.__esModule = true; +exports.T = void 0; +function Foo() { } +exports.Foo = Foo; +; + + //// [/a/b/file1Consumer1.js] file written with same contents Output:: @@ -138,6 +146,7 @@ export var T: number;export function Foo() { };var T1: number; //// [/a/b/moduleFile1.js] "use strict"; exports.__esModule = true; +exports.T = void 0; function Foo() { } exports.Foo = Foo; ; diff --git a/tests/baselines/reference/tscWatch/emit/emit-for-configured-projects/should-return-cascaded-affected-file-list.js b/tests/baselines/reference/tscWatch/emit/emit-for-configured-projects/should-return-cascaded-affected-file-list.js index 7bce15e9b59..0142035e916 100644 --- a/tests/baselines/reference/tscWatch/emit/emit-for-configured-projects/should-return-cascaded-affected-file-list.js +++ b/tests/baselines/reference/tscWatch/emit/emit-for-configured-projects/should-return-cascaded-affected-file-list.js @@ -130,7 +130,13 @@ Change:: change file1Consumer1 //// [/a/b/file1Consumer1.ts] import {Foo} from "./moduleFile1"; export var y = 10;export var T: number; -//// [/a/b/file1Consumer1.js] file written with same contents +//// [/a/b/file1Consumer1.js] +"use strict"; +exports.__esModule = true; +exports.y = 10; +exports.T = void 0; + + //// [/a/b/file1Consumer1Consumer1.js] file written with same contents Output:: @@ -190,7 +196,15 @@ Change:: Change the content of moduleFile1 to `export var T: number;export funct //// [/a/b/moduleFile1.ts] export var T: number;export function Foo() { }; -//// [/a/b/moduleFile1.js] file written with same contents +//// [/a/b/moduleFile1.js] +"use strict"; +exports.__esModule = true; +exports.T = void 0; +function Foo() { } +exports.Foo = Foo; +; + + //// [/a/b/file1Consumer1.js] file written with same contents //// [/a/b/file1Consumer2.js] file written with same contents @@ -255,8 +269,23 @@ export var T2: number;export function Foo() { }; //// [/a/b/file1Consumer1.ts] import {Foo} from "./moduleFile1"; export var y = 10;export var T: number;export var T2: number; -//// [/a/b/moduleFile1.js] file written with same contents -//// [/a/b/file1Consumer1.js] file written with same contents +//// [/a/b/moduleFile1.js] +"use strict"; +exports.__esModule = true; +exports.T2 = void 0; +function Foo() { } +exports.Foo = Foo; +; + + +//// [/a/b/file1Consumer1.js] +"use strict"; +exports.__esModule = true; +exports.y = 10; +exports.T = void 0; +exports.T2 = void 0; + + //// [/a/b/file1Consumer1Consumer1.js] file written with same contents //// [/a/b/file1Consumer2.js] file written with same contents diff --git a/tests/baselines/reference/typeGuardsInExternalModule.js b/tests/baselines/reference/typeGuardsInExternalModule.js index 03f2d2cee8d..c4eae3d6bf4 100644 --- a/tests/baselines/reference/typeGuardsInExternalModule.js +++ b/tests/baselines/reference/typeGuardsInExternalModule.js @@ -39,6 +39,7 @@ else { } // exported variable in external module var strOrNum; +exports.var2 = void 0; if (typeof exports.var2 === "string") { // export makes the var property and not variable strOrNum = exports.var2; // string | number diff --git a/tests/baselines/reference/typeReferenceDirectives7.js b/tests/baselines/reference/typeReferenceDirectives7.js index 7be0651a581..7170fef98b6 100644 --- a/tests/baselines/reference/typeReferenceDirectives7.js +++ b/tests/baselines/reference/typeReferenceDirectives7.js @@ -19,6 +19,7 @@ export let y = () => x /// exports.__esModule = true; exports.$ = 1; +exports.x = void 0; exports.y = function () { return exports.x; }; diff --git a/tests/baselines/reference/typeofANonExportedType.js b/tests/baselines/reference/typeofANonExportedType.js index 97edc2d0922..e51c2f490d2 100644 --- a/tests/baselines/reference/typeofANonExportedType.js +++ b/tests/baselines/reference/typeofANonExportedType.js @@ -55,14 +55,23 @@ export var r13: typeof foo; "use strict"; exports.__esModule = true; var x = 1; +exports.r1 = void 0; var y = { foo: '' }; +exports.r2 = void 0; var C = /** @class */ (function () { function C() { } return C; }()); +exports.c = void 0; var c2; +exports.r3 = void 0; +exports.r4 = void 0; +exports.r4b = void 0; +exports.i = void 0; var i2; +exports.r5 = void 0; +exports.r5 = void 0; var M; (function (M) { M.foo = ''; @@ -73,10 +82,17 @@ var M; }()); M.C = C; })(M || (M = {})); +exports.r6 = void 0; +exports.r7 = void 0; +exports.r8 = void 0; +exports.r9 = void 0; var E; (function (E) { E[E["A"] = 0] = "A"; })(E || (E = {})); +exports.r10 = void 0; +exports.r11 = void 0; +exports.r12 = void 0; function foo() { } (function (foo) { foo.y = 1; @@ -87,3 +103,4 @@ function foo() { } }()); foo.C = C; })(foo || (foo = {})); +exports.r13 = void 0; diff --git a/tests/baselines/reference/typeofAnExportedType.js b/tests/baselines/reference/typeofAnExportedType.js index 54d1e85c32c..ac4dc20edb3 100644 --- a/tests/baselines/reference/typeofAnExportedType.js +++ b/tests/baselines/reference/typeofAnExportedType.js @@ -55,15 +55,24 @@ export var r13: typeof foo; "use strict"; exports.__esModule = true; exports.x = 1; +exports.r1 = void 0; exports.y = { foo: '' }; +exports.r2 = void 0; var C = /** @class */ (function () { function C() { } return C; }()); exports.C = C; +exports.c = void 0; var c2; +exports.r3 = void 0; +exports.r4 = void 0; +exports.r4b = void 0; +exports.i = void 0; var i2; +exports.r5 = void 0; +exports.r5 = void 0; var M; (function (M) { M.foo = ''; @@ -74,11 +83,18 @@ var M; }()); M.C = C; })(M = exports.M || (exports.M = {})); +exports.r6 = void 0; +exports.r7 = void 0; exports.Z = M; +exports.r8 = void 0; +exports.r9 = void 0; var E; (function (E) { E[E["A"] = 0] = "A"; })(E = exports.E || (exports.E = {})); +exports.r10 = void 0; +exports.r11 = void 0; +exports.r12 = void 0; function foo() { } exports.foo = foo; (function (foo) { @@ -90,3 +106,4 @@ exports.foo = foo; }()); foo.C = C; })(foo = exports.foo || (exports.foo = {})); +exports.r13 = void 0; diff --git a/tests/baselines/reference/umd-errors.js b/tests/baselines/reference/umd-errors.js index 2c9fbd809e1..87f44fea791 100644 --- a/tests/baselines/reference/umd-errors.js +++ b/tests/baselines/reference/umd-errors.js @@ -34,3 +34,5 @@ export as namespace C2; //// [err5.js] "use strict"; exports.__esModule = true; +// Illegal, may not appear in implementation files +exports.v = void 0; diff --git a/tests/baselines/reference/unusedVariablesinModules1.js b/tests/baselines/reference/unusedVariablesinModules1.js index 474145c6336..91606bc1517 100644 --- a/tests/baselines/reference/unusedVariablesinModules1.js +++ b/tests/baselines/reference/unusedVariablesinModules1.js @@ -9,3 +9,4 @@ export var y: string; "use strict"; exports.__esModule = true; var x; +exports.y = void 0; diff --git a/tests/baselines/reference/withExportDecl.js b/tests/baselines/reference/withExportDecl.js index 97d528ecd62..ff26e8f2c68 100644 --- a/tests/baselines/reference/withExportDecl.js +++ b/tests/baselines/reference/withExportDecl.js @@ -63,6 +63,7 @@ define(["require", "exports"], function (require, exports) { "use strict"; exports.__esModule = true; var simpleVar; + exports.exportedSimpleVar = void 0; var anotherVar; var varWithSimpleType; var varWithArrayType; @@ -71,6 +72,7 @@ define(["require", "exports"], function (require, exports) { var withComplicatedValue = { x: 30, y: 70, desc: "position" }; exports.exportedWithComplicatedValue = { x: 30, y: 70, desc: "position" }; var arrayVar = ['a', 'b']; + exports.exportedArrayVar = void 0; exports.exportedArrayVar.push({ x: 30, y: 'hello world' }); function simpleFunction() { return { @@ -97,9 +99,9 @@ define(["require", "exports"], function (require, exports) { } m3.foo = foo; })(m3 = exports.m3 || (exports.m3 = {})); - exports.eVar2 = 10; + exports.eVar1 = void 0, exports.eVar2 = 10; var eVar22; - exports.eVar3 = 10; + exports.eVar3 = 10, exports.eVar4 = void 0, exports.eVar5 = void 0; }); From af901ba91193051bc946a501f3f6620b01471809 Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com> Date: Wed, 26 Feb 2020 09:07:45 -0800 Subject: [PATCH 2/9] No error on `this` exprs in static property inits (#36781) No error on `this` expressions in static property declaration initialisers when targetting ESNext and with useDefineForClassFields. In this case the emit is correct and the types are correct, so the error should not be issued. --- src/compiler/checker.ts | 2 +- .../reference/thisInClassBodyStaticESNext.js | 20 +++++++++++++ .../thisInClassBodyStaticESNext.symbols | 25 +++++++++++++++++ .../thisInClassBodyStaticESNext.types | 28 +++++++++++++++++++ .../compiler/thisInClassBodyStaticESNext.ts | 11 ++++++++ 5 files changed, 85 insertions(+), 1 deletion(-) create mode 100644 tests/baselines/reference/thisInClassBodyStaticESNext.js create mode 100644 tests/baselines/reference/thisInClassBodyStaticESNext.symbols create mode 100644 tests/baselines/reference/thisInClassBodyStaticESNext.types create mode 100644 tests/cases/compiler/thisInClassBodyStaticESNext.ts diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 43297244e1a..bde439b0382 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -20947,7 +20947,7 @@ namespace ts { break; case SyntaxKind.PropertyDeclaration: case SyntaxKind.PropertySignature: - if (hasModifier(container, ModifierFlags.Static)) { + if (hasModifier(container, ModifierFlags.Static) && !(compilerOptions.target === ScriptTarget.ESNext && compilerOptions.useDefineForClassFields)) { error(node, Diagnostics.this_cannot_be_referenced_in_a_static_property_initializer); // do not return here so in case if lexical this is captured - it will be reflected in flags on NodeLinks } diff --git a/tests/baselines/reference/thisInClassBodyStaticESNext.js b/tests/baselines/reference/thisInClassBodyStaticESNext.js new file mode 100644 index 00000000000..7f061b12a41 --- /dev/null +++ b/tests/baselines/reference/thisInClassBodyStaticESNext.js @@ -0,0 +1,20 @@ +//// [thisInClassBodyStaticESNext.ts] +// all are allowed with es-compliant class field emit +class Foo { + x = this + static t = this + static at = () => this + static ft = function () { return this } + static mt() { return this } +} + + +//// [thisInClassBodyStaticESNext.js] +// all are allowed with es-compliant class field emit +class Foo { + x = this; + static t = this; + static at = () => this; + static ft = function () { return this; }; + static mt() { return this; } +} diff --git a/tests/baselines/reference/thisInClassBodyStaticESNext.symbols b/tests/baselines/reference/thisInClassBodyStaticESNext.symbols new file mode 100644 index 00000000000..7dc9767ccdf --- /dev/null +++ b/tests/baselines/reference/thisInClassBodyStaticESNext.symbols @@ -0,0 +1,25 @@ +=== tests/cases/compiler/thisInClassBodyStaticESNext.ts === +// all are allowed with es-compliant class field emit +class Foo { +>Foo : Symbol(Foo, Decl(thisInClassBodyStaticESNext.ts, 0, 0)) + + x = this +>x : Symbol(Foo.x, Decl(thisInClassBodyStaticESNext.ts, 1, 11)) +>this : Symbol(Foo, Decl(thisInClassBodyStaticESNext.ts, 0, 0)) + + static t = this +>t : Symbol(Foo.t, Decl(thisInClassBodyStaticESNext.ts, 2, 12)) +>this : Symbol(Foo, Decl(thisInClassBodyStaticESNext.ts, 0, 0)) + + static at = () => this +>at : Symbol(Foo.at, Decl(thisInClassBodyStaticESNext.ts, 3, 19)) +>this : Symbol(Foo, Decl(thisInClassBodyStaticESNext.ts, 0, 0)) + + static ft = function () { return this } +>ft : Symbol(Foo.ft, Decl(thisInClassBodyStaticESNext.ts, 4, 26)) + + static mt() { return this } +>mt : Symbol(Foo.mt, Decl(thisInClassBodyStaticESNext.ts, 5, 43)) +>this : Symbol(Foo, Decl(thisInClassBodyStaticESNext.ts, 0, 0)) +} + diff --git a/tests/baselines/reference/thisInClassBodyStaticESNext.types b/tests/baselines/reference/thisInClassBodyStaticESNext.types new file mode 100644 index 00000000000..152e3a0748a --- /dev/null +++ b/tests/baselines/reference/thisInClassBodyStaticESNext.types @@ -0,0 +1,28 @@ +=== tests/cases/compiler/thisInClassBodyStaticESNext.ts === +// all are allowed with es-compliant class field emit +class Foo { +>Foo : Foo + + x = this +>x : this +>this : this + + static t = this +>t : typeof Foo +>this : typeof Foo + + static at = () => this +>at : () => typeof Foo +>() => this : () => typeof Foo +>this : typeof Foo + + static ft = function () { return this } +>ft : () => any +>function () { return this } : () => any +>this : any + + static mt() { return this } +>mt : () => typeof Foo +>this : typeof Foo +} + diff --git a/tests/cases/compiler/thisInClassBodyStaticESNext.ts b/tests/cases/compiler/thisInClassBodyStaticESNext.ts new file mode 100644 index 00000000000..ae72e6f0bde --- /dev/null +++ b/tests/cases/compiler/thisInClassBodyStaticESNext.ts @@ -0,0 +1,11 @@ +// @target: esnext +// @useDefineForClassFields: true + +// all are allowed with es-compliant class field emit +class Foo { + x = this + static t = this + static at = () => this + static ft = function () { return this } + static mt() { return this } +} From 3d63401b20ce4c42cc0e81be297047bc2ec1e4c3 Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com> Date: Wed, 26 Feb 2020 10:28:22 -0800 Subject: [PATCH 3/9] Update baseline (#37049) --- .../reference/thisInClassBodyStaticESNext.js | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/tests/baselines/reference/thisInClassBodyStaticESNext.js b/tests/baselines/reference/thisInClassBodyStaticESNext.js index 7f061b12a41..915ae5e67d0 100644 --- a/tests/baselines/reference/thisInClassBodyStaticESNext.js +++ b/tests/baselines/reference/thisInClassBodyStaticESNext.js @@ -11,10 +11,13 @@ class Foo { //// [thisInClassBodyStaticESNext.js] // all are allowed with es-compliant class field emit -class Foo { - x = this; - static t = this; - static at = () => this; - static ft = function () { return this; }; - static mt() { return this; } -} +const Foo = /** @class */ (() => { + class Foo { + x = this; + static t = this; + static at = () => this; + static ft = function () { return this; }; + static mt() { return this; } + } + return Foo; +})(); From b424f36e9a3108eb4b21ccc25f96de4b302473bc Mon Sep 17 00:00:00 2001 From: Andrew Casey Date: Wed, 26 Feb 2020 12:55:28 -0800 Subject: [PATCH 4/9] Expose call count for instantiateType in extendedDiagnostics (#36797) * Expose call count for instantiateType in extendedDiagnostics * Update API baselines --- src/compiler/checker.ts | 3 +++ src/compiler/program.ts | 1 + src/compiler/types.ts | 2 ++ src/executeCommandLine/executeCommandLine.ts | 1 + tests/baselines/reference/api/tsserverlibrary.d.ts | 1 + tests/baselines/reference/api/typescript.d.ts | 1 + 6 files changed, 9 insertions(+) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index bde439b0382..34e8a6336ae 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -298,6 +298,7 @@ namespace ts { let typeCount = 0; let symbolCount = 0; let enumCount = 0; + let totalInstantiationCount = 0; let instantiationCount = 0; let instantiationDepth = 0; let constraintDepth = 0; @@ -348,6 +349,7 @@ namespace ts { getIdentifierCount: () => sum(host.getSourceFiles(), "identifierCount"), getSymbolCount: () => sum(host.getSourceFiles(), "symbolCount") + symbolCount, getTypeCount: () => typeCount, + getInstantiationCount: () => totalInstantiationCount, getRelationCacheSizes: () => ({ assignable: assignableRelation.size, identity: identityRelation.size, @@ -13775,6 +13777,7 @@ namespace ts { error(currentNode, Diagnostics.Type_instantiation_is_excessively_deep_and_possibly_infinite); return errorType; } + totalInstantiationCount++; instantiationCount++; instantiationDepth++; const result = instantiateTypeWorker(type, mapper); diff --git a/src/compiler/program.ts b/src/compiler/program.ts index 4675ae8493d..3519e07ab46 100644 --- a/src/compiler/program.ts +++ b/src/compiler/program.ts @@ -946,6 +946,7 @@ namespace ts { getIdentifierCount: () => getDiagnosticsProducingTypeChecker().getIdentifierCount(), getSymbolCount: () => getDiagnosticsProducingTypeChecker().getSymbolCount(), getTypeCount: () => getDiagnosticsProducingTypeChecker().getTypeCount(), + getInstantiationCount: () => getDiagnosticsProducingTypeChecker().getInstantiationCount(), getRelationCacheSizes: () => getDiagnosticsProducingTypeChecker().getRelationCacheSizes(), getFileProcessingDiagnostics: () => fileProcessingDiagnostics, getResolvedTypeReferenceDirectives: () => resolvedTypeReferenceDirectives, diff --git a/src/compiler/types.ts b/src/compiler/types.ts index 74cd04d7674..36c3f44268d 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -3235,6 +3235,7 @@ namespace ts { getIdentifierCount(): number; getSymbolCount(): number; getTypeCount(): number; + getInstantiationCount(): number; getRelationCacheSizes(): { assignable: number, identity: number, subtype: number, strictSubtype: number }; /* @internal */ getFileProcessingDiagnostics(): DiagnosticCollection; @@ -3557,6 +3558,7 @@ namespace ts { /* @internal */ getIdentifierCount(): number; /* @internal */ getSymbolCount(): number; /* @internal */ getTypeCount(): number; + /* @internal */ getInstantiationCount(): number; /* @internal */ getRelationCacheSizes(): { assignable: number, identity: number, subtype: number, strictSubtype: number }; /* @internal */ isArrayType(type: Type): boolean; diff --git a/src/executeCommandLine/executeCommandLine.ts b/src/executeCommandLine/executeCommandLine.ts index 6ce8e90a1df..e66b55d9b55 100644 --- a/src/executeCommandLine/executeCommandLine.ts +++ b/src/executeCommandLine/executeCommandLine.ts @@ -639,6 +639,7 @@ namespace ts { reportCountStatistic("Identifiers", program.getIdentifierCount()); reportCountStatistic("Symbols", program.getSymbolCount()); reportCountStatistic("Types", program.getTypeCount()); + reportCountStatistic("Instantiations", program.getInstantiationCount()); if (memoryUsed >= 0) { reportStatisticalValue("Memory used", Math.round(memoryUsed / 1000) + "K"); diff --git a/tests/baselines/reference/api/tsserverlibrary.d.ts b/tests/baselines/reference/api/tsserverlibrary.d.ts index 45f4d38414e..03a59f53345 100644 --- a/tests/baselines/reference/api/tsserverlibrary.d.ts +++ b/tests/baselines/reference/api/tsserverlibrary.d.ts @@ -1952,6 +1952,7 @@ declare namespace ts { getIdentifierCount(): number; getSymbolCount(): number; getTypeCount(): number; + getInstantiationCount(): number; getRelationCacheSizes(): { assignable: number; identity: number; diff --git a/tests/baselines/reference/api/typescript.d.ts b/tests/baselines/reference/api/typescript.d.ts index 83e2a6ac5d4..469e9e5b6aa 100644 --- a/tests/baselines/reference/api/typescript.d.ts +++ b/tests/baselines/reference/api/typescript.d.ts @@ -1952,6 +1952,7 @@ declare namespace ts { getIdentifierCount(): number; getSymbolCount(): number; getTypeCount(): number; + getInstantiationCount(): number; getRelationCacheSizes(): { assignable: number; identity: number; From 42058a89ab37293150b1113426f7b74ecd57e278 Mon Sep 17 00:00:00 2001 From: csigs Date: Wed, 26 Feb 2020 22:10:40 +0000 Subject: [PATCH 5/9] LEGO: check in for master to temporary branch. --- .../diagnosticMessages.generated.json.lcl | 72 +++++++++++++++++++ 1 file changed, 72 insertions(+) diff --git a/src/loc/lcl/trk/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/trk/diagnosticMessages/diagnosticMessages.generated.json.lcl index 1b79cea49e5..5651e368fd8 100644 --- a/src/loc/lcl/trk/diagnosticMessages/diagnosticMessages.generated.json.lcl +++ b/src/loc/lcl/trk/diagnosticMessages/diagnosticMessages.generated.json.lcl @@ -1298,6 +1298,9 @@ + + + @@ -1712,6 +1715,9 @@ + + + @@ -2876,6 +2882,9 @@ + + + @@ -3476,6 +3485,9 @@ + + + @@ -3491,6 +3503,9 @@ + + + @@ -4745,6 +4760,9 @@ + + + @@ -5687,6 +5705,9 @@ + + + @@ -6272,6 +6293,9 @@ + + + @@ -7103,6 +7127,9 @@ + + + @@ -7160,6 +7187,9 @@ + + + @@ -8528,6 +8558,9 @@ + + + @@ -8843,6 +8876,12 @@ + + + + + + @@ -8969,6 +9008,9 @@ + + + @@ -9026,6 +9068,9 @@ + + + @@ -9053,12 +9098,18 @@ + + + + + + @@ -9404,6 +9455,9 @@ + + + @@ -9494,6 +9548,9 @@ + + + @@ -9530,6 +9587,9 @@ + + + @@ -9854,6 +9914,9 @@ + + + @@ -9869,6 +9932,9 @@ + + + @@ -9902,6 +9968,9 @@ + + + @@ -9923,6 +9992,9 @@ + + + From c4e96856acda9260e936ade829ce8fd3a2879af4 Mon Sep 17 00:00:00 2001 From: Ryan Cavanaugh Date: Wed, 26 Feb 2020 14:59:04 -0800 Subject: [PATCH 6/9] Detect circularities when removing 'undefined' from defaulted params (#37023) Fixes #37008 Note that referencing a variable in its initializer is a TDZ error; the OP report had OOB logic that prevented this in practice (?) --- src/compiler/checker.ts | 20 ++++++++---- .../circularOptionalityRemoval.errors.txt | 32 +++++++++++++++++++ .../reference/circularOptionalityRemoval.js | 16 ++++++++++ .../circularOptionalityRemoval.symbols | 14 ++++++++ .../circularOptionalityRemoval.types | 21 ++++++++++++ .../compiler/circularOptionalityRemoval.ts | 7 ++++ 6 files changed, 104 insertions(+), 6 deletions(-) create mode 100644 tests/baselines/reference/circularOptionalityRemoval.errors.txt create mode 100644 tests/baselines/reference/circularOptionalityRemoval.js create mode 100644 tests/baselines/reference/circularOptionalityRemoval.symbols create mode 100644 tests/baselines/reference/circularOptionalityRemoval.types create mode 100644 tests/cases/compiler/circularOptionalityRemoval.ts diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 34e8a6336ae..21d485c0023 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -20522,12 +20522,20 @@ namespace ts { /** remove undefined from the annotated type of a parameter when there is an initializer (that doesn't include undefined) */ function removeOptionalityFromDeclaredType(declaredType: Type, declaration: VariableLikeDeclaration): Type { - const annotationIncludesUndefined = strictNullChecks && - declaration.kind === SyntaxKind.Parameter && - declaration.initializer && - getFalsyFlags(declaredType) & TypeFlags.Undefined && - !(getFalsyFlags(checkExpression(declaration.initializer)) & TypeFlags.Undefined); - return annotationIncludesUndefined ? getTypeWithFacts(declaredType, TypeFacts.NEUndefined) : declaredType; + if (pushTypeResolution(declaration.symbol, TypeSystemPropertyName.DeclaredType)) { + const annotationIncludesUndefined = strictNullChecks && + declaration.kind === SyntaxKind.Parameter && + declaration.initializer && + getFalsyFlags(declaredType) & TypeFlags.Undefined && + !(getFalsyFlags(checkExpression(declaration.initializer)) & TypeFlags.Undefined); + popTypeResolution(); + + return annotationIncludesUndefined ? getTypeWithFacts(declaredType, TypeFacts.NEUndefined) : declaredType; + } + else { + reportCircularityError(declaration.symbol); + return declaredType; + } } function isConstraintPosition(node: Node) { diff --git a/tests/baselines/reference/circularOptionalityRemoval.errors.txt b/tests/baselines/reference/circularOptionalityRemoval.errors.txt new file mode 100644 index 00000000000..2b60b5b6621 --- /dev/null +++ b/tests/baselines/reference/circularOptionalityRemoval.errors.txt @@ -0,0 +1,32 @@ +tests/cases/compiler/circularOptionalityRemoval.ts(2,14): error TS2502: 'x' is referenced directly or indirectly in its own type annotation. +tests/cases/compiler/circularOptionalityRemoval.ts(2,38): error TS2372: Parameter 'x' cannot be referenced in its initializer. +tests/cases/compiler/circularOptionalityRemoval.ts(2,38): error TS2532: Object is possibly 'undefined'. +tests/cases/compiler/circularOptionalityRemoval.ts(2,46): error TS2372: Parameter 'x' cannot be referenced in its initializer. +tests/cases/compiler/circularOptionalityRemoval.ts(5,14): error TS1015: Parameter cannot have question mark and initializer. +tests/cases/compiler/circularOptionalityRemoval.ts(5,14): error TS2502: 'x' is referenced directly or indirectly in its own type annotation. +tests/cases/compiler/circularOptionalityRemoval.ts(5,27): error TS2304: Cannot find name 'someCondition'. +tests/cases/compiler/circularOptionalityRemoval.ts(5,54): error TS2372: Parameter 'x' cannot be referenced in its initializer. + + +==== tests/cases/compiler/circularOptionalityRemoval.ts (8 errors) ==== + // Constructed repro + function fn1(x: number | undefined = x > 0 ? x : 0) { } + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2502: 'x' is referenced directly or indirectly in its own type annotation. + ~ +!!! error TS2372: Parameter 'x' cannot be referenced in its initializer. + ~ +!!! error TS2532: Object is possibly 'undefined'. + ~ +!!! error TS2372: Parameter 'x' cannot be referenced in its initializer. + + // Report from user + function fn2(x?: string = someCondition ? 'value1' : x) { } + ~ +!!! error TS1015: Parameter cannot have question mark and initializer. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2502: 'x' is referenced directly or indirectly in its own type annotation. + ~~~~~~~~~~~~~ +!!! error TS2304: Cannot find name 'someCondition'. + ~ +!!! error TS2372: Parameter 'x' cannot be referenced in its initializer. \ No newline at end of file diff --git a/tests/baselines/reference/circularOptionalityRemoval.js b/tests/baselines/reference/circularOptionalityRemoval.js new file mode 100644 index 00000000000..c584c2f3949 --- /dev/null +++ b/tests/baselines/reference/circularOptionalityRemoval.js @@ -0,0 +1,16 @@ +//// [circularOptionalityRemoval.ts] +// Constructed repro +function fn1(x: number | undefined = x > 0 ? x : 0) { } + +// Report from user +function fn2(x?: string = someCondition ? 'value1' : x) { } + +//// [circularOptionalityRemoval.js] +// Constructed repro +function fn1(x) { + if (x === void 0) { x = x > 0 ? x : 0; } +} +// Report from user +function fn2(x) { + if (x === void 0) { x = someCondition ? 'value1' : x; } +} diff --git a/tests/baselines/reference/circularOptionalityRemoval.symbols b/tests/baselines/reference/circularOptionalityRemoval.symbols new file mode 100644 index 00000000000..06bfd9da771 --- /dev/null +++ b/tests/baselines/reference/circularOptionalityRemoval.symbols @@ -0,0 +1,14 @@ +=== tests/cases/compiler/circularOptionalityRemoval.ts === +// Constructed repro +function fn1(x: number | undefined = x > 0 ? x : 0) { } +>fn1 : Symbol(fn1, Decl(circularOptionalityRemoval.ts, 0, 0)) +>x : Symbol(x, Decl(circularOptionalityRemoval.ts, 1, 13)) +>x : Symbol(x, Decl(circularOptionalityRemoval.ts, 1, 13)) +>x : Symbol(x, Decl(circularOptionalityRemoval.ts, 1, 13)) + +// Report from user +function fn2(x?: string = someCondition ? 'value1' : x) { } +>fn2 : Symbol(fn2, Decl(circularOptionalityRemoval.ts, 1, 55)) +>x : Symbol(x, Decl(circularOptionalityRemoval.ts, 4, 13)) +>x : Symbol(x, Decl(circularOptionalityRemoval.ts, 4, 13)) + diff --git a/tests/baselines/reference/circularOptionalityRemoval.types b/tests/baselines/reference/circularOptionalityRemoval.types new file mode 100644 index 00000000000..5783b24a6c3 --- /dev/null +++ b/tests/baselines/reference/circularOptionalityRemoval.types @@ -0,0 +1,21 @@ +=== tests/cases/compiler/circularOptionalityRemoval.ts === +// Constructed repro +function fn1(x: number | undefined = x > 0 ? x : 0) { } +>fn1 : (x?: number | undefined) => void +>x : number | undefined +>x > 0 ? x : 0 : number | undefined +>x > 0 : boolean +>x : number | undefined +>0 : 0 +>x : number | undefined +>0 : 0 + +// Report from user +function fn2(x?: string = someCondition ? 'value1' : x) { } +>fn2 : (x?: string | undefined) => void +>x : string | undefined +>someCondition ? 'value1' : x : string | undefined +>someCondition : any +>'value1' : "value1" +>x : string | undefined + diff --git a/tests/cases/compiler/circularOptionalityRemoval.ts b/tests/cases/compiler/circularOptionalityRemoval.ts new file mode 100644 index 00000000000..20a6a408570 --- /dev/null +++ b/tests/cases/compiler/circularOptionalityRemoval.ts @@ -0,0 +1,7 @@ +// @strictNullChecks: true + +// Constructed repro +function fn1(x: number | undefined = x > 0 ? x : 0) { } + +// Report from user +function fn2(x?: string = someCondition ? 'value1' : x) { } \ No newline at end of file From 05c9ec3f12d214d3e95422dc1018ccc2ddc2800b Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Wed, 26 Feb 2020 15:25:51 -0800 Subject: [PATCH 7/9] Remove unnecessary assert (since we allow already open file to be opened again even through openFile command - partially) from updateOpen command (#37059) Fixes #35034 --- src/server/editorServices.ts | 9 +--- .../tsserver/applyChangesToOpenFiles.ts | 51 +++++++++++++++---- src/testRunner/unittests/tsserver/openFile.ts | 24 +++++++++ 3 files changed, 68 insertions(+), 16 deletions(-) diff --git a/src/server/editorServices.ts b/src/server/editorServices.ts index 3412c1c1598..47ab9e6a12f 100644 --- a/src/server/editorServices.ts +++ b/src/server/editorServices.ts @@ -2414,7 +2414,7 @@ namespace ts.server { this.openFilesWithNonRootedDiskPath.set(this.toCanonicalFileName(fileName), info); } } - if (openedByClient && !info.isScriptOpen()) { + if (openedByClient) { // Opening closed script info // either it was created just now, or was part of projects but was closed this.stopWatchingScriptInfo(info); @@ -2423,9 +2423,6 @@ namespace ts.server { info.registerFileUpdate(); } } - else { - Debug.assert(fileContent === undefined); - } return info; } @@ -3170,11 +3167,9 @@ namespace ts.server { const iterResult = openFiles.next(); if (iterResult.done) break; const file = iterResult.value; - const scriptInfo = this.getScriptInfo(file.fileName); - Debug.assert(!scriptInfo || !scriptInfo.isScriptOpen(), "Script should not exist and not be open already"); // Create script infos so we have the new content for all the open files before we do any updates to projects const info = this.getOrCreateOpenScriptInfo( - scriptInfo ? scriptInfo.fileName : toNormalizedPath(file.fileName), + toNormalizedPath(file.fileName), file.content, tryConvertScriptKindName(file.scriptKind!), file.hasMixedContent, diff --git a/src/testRunner/unittests/tsserver/applyChangesToOpenFiles.ts b/src/testRunner/unittests/tsserver/applyChangesToOpenFiles.ts index 316ecc8b652..6d5ee91d68d 100644 --- a/src/testRunner/unittests/tsserver/applyChangesToOpenFiles.ts +++ b/src/testRunner/unittests/tsserver/applyChangesToOpenFiles.ts @@ -29,7 +29,11 @@ ${file.content}`; assert.equal(Number(project.getProjectVersion()), expected); } - function verify(applyChangesToOpen: (session: TestSession) => void) { + interface Verify { + applyChangesToOpen: (session: TestSession) => void; + openFile1Again: (session: TestSession) => void; + } + function verify({ applyChangesToOpen, openFile1Again }: Verify) { const host = createServerHost([app, file3, commonFile1, commonFile2, libFile, configFile]); const session = createSession(host); session.executeCommandSeq({ @@ -65,11 +69,22 @@ ${file.content}`; verifyText(service, commonFile2.path, fileContentWithComment(commonFile2)); verifyText(service, app.path, "let zzz = 10;let zz = 10;let z = 1;"); verifyText(service, file3.path, file3.content); + + // Open file1 again + openFile1Again(session); + assert.isTrue(service.getScriptInfo(commonFile1.path)!.isScriptOpen()); + + // Verify that file1 contents are changed + verifyProjectVersion(project, 4); + verifyText(service, commonFile1.path, commonFile1.content); + verifyText(service, commonFile2.path, fileContentWithComment(commonFile2)); + verifyText(service, app.path, "let zzz = 10;let zz = 10;let z = 1;"); + verifyText(service, file3.path, file3.content); } it("with applyChangedToOpenFiles request", () => { - verify(session => - session.executeCommandSeq({ + verify({ + applyChangesToOpen: session => session.executeCommandSeq({ command: protocol.CommandTypes.ApplyChangedToOpenFiles, arguments: { openFiles: [ @@ -101,13 +116,22 @@ ${file.content}`; file3.path ] } - }) - ); + }), + openFile1Again: session => session.executeCommandSeq({ + command: protocol.CommandTypes.ApplyChangedToOpenFiles, + arguments: { + openFiles: [{ + fileName: commonFile1.path, + content: commonFile1.content + }] + } + }), + }); }); it("with updateOpen request", () => { - verify(session => - session.executeCommandSeq({ + verify({ + applyChangesToOpen: session => session.executeCommandSeq({ command: protocol.CommandTypes.UpdateOpen, arguments: { openFiles: [ @@ -141,8 +165,17 @@ ${file.content}`; file3.path ] } - }) - ); + }), + openFile1Again: session => session.executeCommandSeq({ + command: protocol.CommandTypes.UpdateOpen, + arguments: { + openFiles: [{ + file: commonFile1.path, + fileContent: commonFile1.content + }] + } + }), + }); }); }); } diff --git a/src/testRunner/unittests/tsserver/openFile.ts b/src/testRunner/unittests/tsserver/openFile.ts index d2a995c68f8..62a7fcc729a 100644 --- a/src/testRunner/unittests/tsserver/openFile.ts +++ b/src/testRunner/unittests/tsserver/openFile.ts @@ -104,5 +104,29 @@ namespace ts.projectSystem { checkProjectActualFiles(project, files.map(f => f.path)); } }); + + it("can open same file again", () => { + const projectFolder = "/user/someuser/projects/myproject"; + const aFile: File = { + path: `${projectFolder}/src/a.ts`, + content: "export const x = 0;" + }; + const configFile: File = { + path: `${projectFolder}/tsconfig.json`, + content: "{}" + }; + const files = [aFile, configFile, libFile]; + const host = createServerHost(files); + const service = createProjectService(host); + verifyProject(aFile.content); + verifyProject(`${aFile.content}export const y = 10;`); + + function verifyProject(aFileContent: string) { + service.openClientFile(aFile.path, aFileContent, ScriptKind.TS, projectFolder); + const project = service.configuredProjects.get(configFile.path)!; + checkProjectActualFiles(project, files.map(f => f.path)); + assert.equal(project.getCurrentProgram()?.getSourceFile(aFile.path)!.text, aFileContent); + } + }); }); } From d07761fe3944f48c7518cf4199a82466a664a347 Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Wed, 26 Feb 2020 15:26:26 -0800 Subject: [PATCH 8/9] Allow --composite false or --composite null on the command line (#36997) * Add tests for specifying composite as command line option * Allow passing --composite false on commandline * Add test to verify tsc --composite false from command line * Handle "undefined" as option value to be set to undefined for that option * Support "null" as option to be converted to undefined which is normally end result from our config file as well * Support null as option for any tsconfig only option as well, and dont support undefined * Fix public api test case * Validates objects instead of stringify result * Add composite true to base source --- src/compiler/commandLineParser.ts | 96 ++++++--- src/compiler/diagnosticMessages.json | 6 +- src/testRunner/tsconfig.json | 1 + .../unittests/config/commandLineParsing.ts | 199 ++++++++++++++++-- src/testRunner/unittests/tsc/composite.ts | 85 ++++++++ ...and-line-but-has-tsbuild-info-in-config.js | 11 + ...and-line-but-has-tsbuild-info-in-config.js | 12 ++ ...setting-composite-false-on-command-line.js | 11 + ...-setting-composite-null-on-command-line.js | 11 + 9 files changed, 384 insertions(+), 48 deletions(-) create mode 100644 src/testRunner/unittests/tsc/composite.ts create mode 100644 tests/baselines/reference/tsc/composite/initial-build/when-setting-composite-false-and-tsbuildinfo-as-null-on-command-line-but-has-tsbuild-info-in-config.js create mode 100644 tests/baselines/reference/tsc/composite/initial-build/when-setting-composite-false-on-command-line-but-has-tsbuild-info-in-config.js create mode 100644 tests/baselines/reference/tsc/composite/initial-build/when-setting-composite-false-on-command-line.js create mode 100644 tests/baselines/reference/tsc/composite/initial-build/when-setting-composite-null-on-command-line.js diff --git a/src/compiler/commandLineParser.ts b/src/compiler/commandLineParser.ts index e425445fc32..72bc87d4eee 100644 --- a/src/compiler/commandLineParser.ts +++ b/src/compiler/commandLineParser.ts @@ -1164,11 +1164,13 @@ namespace ts { } } - interface OptionsBase { + /*@internal*/ + export interface OptionsBase { [option: string]: CompilerOptionsValue | TsConfigSourceFile | undefined; } - interface ParseCommandLineWorkerDiagnostics extends DidYouMeanOptionsDiagnostics { + /*@internal*/ + export interface ParseCommandLineWorkerDiagnostics extends DidYouMeanOptionsDiagnostics { getOptionsNameMap: () => OptionsNameMap; optionTypeMismatchDiagnostic: DiagnosticMessage; } @@ -1189,7 +1191,8 @@ namespace ts { createDiagnostics(diagnostics.unknownOptionDiagnostic, unknownOptionErrorText || unknownOption); } - function parseCommandLineWorker( + /*@internal*/ + export function parseCommandLineWorker( diagnostics: ParseCommandLineWorkerDiagnostics, commandLine: readonly string[], readFile?: (path: string) => string | undefined) { @@ -1279,7 +1282,25 @@ namespace ts { errors: Diagnostic[] ) { if (opt.isTSConfigOnly) { - errors.push(createCompilerDiagnostic(Diagnostics.Option_0_can_only_be_specified_in_tsconfig_json_file, opt.name)); + const optValue = args[i]; + if (optValue === "null") { + options[opt.name] = undefined; + i++; + } + else if (opt.type === "boolean") { + if (optValue === "false") { + options[opt.name] = false; + i++; + } + else { + if (optValue === "true") i++; + errors.push(createCompilerDiagnostic(Diagnostics.Option_0_can_only_be_specified_in_tsconfig_json_file_or_set_to_false_or_null_on_command_line, opt.name)); + } + } + else { + errors.push(createCompilerDiagnostic(Diagnostics.Option_0_can_only_be_specified_in_tsconfig_json_file_or_set_to_null_on_command_line, opt.name)); + if (optValue && !startsWith(optValue, "-")) i++; + } } else { // Check to see if no argument was provided (e.g. "--locale" is the last command-line argument). @@ -1287,42 +1308,49 @@ namespace ts { errors.push(createCompilerDiagnostic(diagnostics.optionTypeMismatchDiagnostic, opt.name, getCompilerOptionValueTypeString(opt))); } - switch (opt.type) { - case "number": - options[opt.name] = parseInt(args[i]); - i++; - break; - case "boolean": - // boolean flag has optional value true, false, others - const optValue = args[i]; - options[opt.name] = optValue !== "false"; - // consume next argument as boolean flag value - if (optValue === "false" || optValue === "true") { + if (args[i] !== "null") { + switch (opt.type) { + case "number": + options[opt.name] = parseInt(args[i]); i++; - } - break; - case "string": - options[opt.name] = args[i] || ""; - i++; - break; - case "list": - const result = parseListTypeOption(opt, args[i], errors); - options[opt.name] = result || []; - if (result) { + break; + case "boolean": + // boolean flag has optional value true, false, others + const optValue = args[i]; + options[opt.name] = optValue !== "false"; + // consume next argument as boolean flag value + if (optValue === "false" || optValue === "true") { + i++; + } + break; + case "string": + options[opt.name] = args[i] || ""; i++; - } - break; - // If not a primitive, the possible types are specified in what is effectively a map of options. - default: - options[opt.name] = parseCustomTypeOption(opt, args[i], errors); - i++; - break; + break; + case "list": + const result = parseListTypeOption(opt, args[i], errors); + options[opt.name] = result || []; + if (result) { + i++; + } + break; + // If not a primitive, the possible types are specified in what is effectively a map of options. + default: + options[opt.name] = parseCustomTypeOption(opt, args[i], errors); + i++; + break; + } + } + else { + options[opt.name] = undefined; + i++; } } return i; } - const compilerOptionsDidYouMeanDiagnostics: ParseCommandLineWorkerDiagnostics = { + /*@internal*/ + export const compilerOptionsDidYouMeanDiagnostics: ParseCommandLineWorkerDiagnostics = { getOptionsNameMap, optionDeclarations, unknownOptionDiagnostic: Diagnostics.Unknown_compiler_option_0, @@ -2170,7 +2198,7 @@ namespace ts { } function convertToOptionValueWithAbsolutePaths(option: CommandLineOption | undefined, value: CompilerOptionsValue, toAbsolutePath: (path: string) => string) { - if (option) { + if (option && !isNullOrUndefined(value)) { if (option.type === "list") { const values = value as readonly (string | number)[]; if (option.element.isFilePath && values.length) { diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index 4ee407ce1c1..d64e8d6ee80 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -3642,7 +3642,7 @@ "category": "Message", "code": 6061 }, - "Option '{0}' can only be specified in 'tsconfig.json' file.": { + "Option '{0}' can only be specified in 'tsconfig.json' file or set to 'null' on command line.": { "category": "Error", "code": 6064 }, @@ -4296,6 +4296,10 @@ "category": "Error", "code": 6229 }, + "Option '{0}' can only be specified in 'tsconfig.json' file or set to 'false' or 'null' on command line.": { + "category": "Error", + "code": 6230 + }, "Projects to reference": { "category": "Message", diff --git a/src/testRunner/tsconfig.json b/src/testRunner/tsconfig.json index 909b2fe8c4d..5fdc05ae1ce 100644 --- a/src/testRunner/tsconfig.json +++ b/src/testRunner/tsconfig.json @@ -126,6 +126,7 @@ "unittests/tsbuild/transitiveReferences.ts", "unittests/tsbuild/watchEnvironment.ts", "unittests/tsbuild/watchMode.ts", + "unittests/tsc/composite.ts", "unittests/tsc/declarationEmit.ts", "unittests/tsc/incremental.ts", "unittests/tsc/listFilesOnly.ts", diff --git a/src/testRunner/unittests/config/commandLineParsing.ts b/src/testRunner/unittests/config/commandLineParsing.ts index 47e66bac197..8dbbffaf20d 100644 --- a/src/testRunner/unittests/config/commandLineParsing.ts +++ b/src/testRunner/unittests/config/commandLineParsing.ts @@ -1,11 +1,9 @@ namespace ts { describe("unittests:: config:: commandLineParsing:: parseCommandLine", () => { - function assertParseResult(commandLine: string[], expectedParsedCommandLine: ParsedCommandLine) { - const parsed = parseCommandLine(commandLine); - const parsedCompilerOptions = JSON.stringify(parsed.options); - const expectedCompilerOptions = JSON.stringify(expectedParsedCommandLine.options); - assert.equal(parsedCompilerOptions, expectedCompilerOptions); + function assertParseResult(commandLine: string[], expectedParsedCommandLine: ParsedCommandLine, workerDiagnostic?: () => ParseCommandLineWorkerDiagnostics) { + const parsed = parseCommandLineWorker(workerDiagnostic?.() || compilerOptionsDidYouMeanDiagnostics, commandLine); + assert.deepEqual(parsed.options, expectedParsedCommandLine.options); assert.deepEqual(parsed.watchOptions, expectedParsedCommandLine.watchOptions); const parsedErrors = parsed.errors; @@ -120,7 +118,7 @@ namespace ts { length: undefined, }], fileNames: ["0.ts"], - options: {} + options: { jsx: undefined } }); }); @@ -146,7 +144,7 @@ namespace ts { length: undefined, }], fileNames: ["0.ts"], - options: {} + options: { module: undefined } }); }); @@ -172,7 +170,7 @@ namespace ts { length: undefined, }], fileNames: ["0.ts"], - options: {} + options: { newLine: undefined } }); }); @@ -198,7 +196,7 @@ namespace ts { length: undefined, }], fileNames: ["0.ts"], - options: {} + options: { target: undefined } }); }); @@ -224,7 +222,7 @@ namespace ts { length: undefined, }], fileNames: ["0.ts"], - options: {} + options: { moduleResolution: undefined } }); }); @@ -414,6 +412,183 @@ namespace ts { }); }); + describe("parses command line null for tsconfig only option", () => { + interface VerifyNull { + optionName: string; + nonNullValue?: string; + workerDiagnostic?: () => ParseCommandLineWorkerDiagnostics; + diagnosticMessage: DiagnosticMessage; + } + function verifyNull({ optionName, nonNullValue, workerDiagnostic, diagnosticMessage }: VerifyNull) { + it("allows setting it to null", () => { + assertParseResult( + [`--${optionName}`, "null", "0.ts"], + { + errors: [], + fileNames: ["0.ts"], + options: { [optionName]: undefined } + }, + workerDiagnostic + ); + }); + + if (nonNullValue) { + it("errors if non null value is passed", () => { + assertParseResult( + [`--${optionName}`, nonNullValue, "0.ts"], + { + errors: [{ + messageText: formatStringFromArgs(diagnosticMessage.message, [optionName]), + category: diagnosticMessage.category, + code: diagnosticMessage.code, + file: undefined, + start: undefined, + length: undefined + }], + fileNames: ["0.ts"], + options: {} + }, + workerDiagnostic + ); + }); + } + + it("errors if its followed by another option", () => { + assertParseResult( + ["0.ts", "--strictNullChecks", `--${optionName}`], + { + errors: [{ + messageText: formatStringFromArgs(diagnosticMessage.message, [optionName]), + category: diagnosticMessage.category, + code: diagnosticMessage.code, + file: undefined, + start: undefined, + length: undefined + }], + fileNames: ["0.ts"], + options: { strictNullChecks: true } + }, + workerDiagnostic + ); + }); + + it("errors if its last option", () => { + assertParseResult( + ["0.ts", `--${optionName}`], + { + errors: [{ + messageText: formatStringFromArgs(diagnosticMessage.message, [optionName]), + category: diagnosticMessage.category, + code: diagnosticMessage.code, + file: undefined, + start: undefined, + length: undefined + }], + fileNames: ["0.ts"], + options: {} + }, + workerDiagnostic + ); + }); + } + + interface VerifyNullNonIncludedOption { + type: () => "string" | "number" | Map; + nonNullValue?: string; + } + function verifyNullNonIncludedOption({ type, nonNullValue }: VerifyNullNonIncludedOption) { + verifyNull({ + optionName: "optionName", + nonNullValue, + diagnosticMessage: Diagnostics.Option_0_can_only_be_specified_in_tsconfig_json_file_or_set_to_null_on_command_line, + workerDiagnostic: () => { + const optionDeclarations = [ + ...compilerOptionsDidYouMeanDiagnostics.optionDeclarations, + { + name: "optionName", + type: type(), + isTSConfigOnly: true, + category: Diagnostics.Basic_Options, + description: Diagnostics.Enable_project_compilation, + } + ]; + return { + ...compilerOptionsDidYouMeanDiagnostics, + optionDeclarations, + getOptionsNameMap: () => createOptionNameMap(optionDeclarations) + }; + } + }); + } + + describe("option of type boolean", () => { + it("allows setting it to false", () => { + assertParseResult( + ["--composite", "false", "0.ts"], + { + errors: [], + fileNames: ["0.ts"], + options: { composite: false } + } + ); + }); + + verifyNull({ + optionName: "composite", + nonNullValue: "true", + diagnosticMessage: Diagnostics.Option_0_can_only_be_specified_in_tsconfig_json_file_or_set_to_false_or_null_on_command_line + }); + }); + + describe("option of type object", () => { + verifyNull({ + optionName: "paths", + diagnosticMessage: Diagnostics.Option_0_can_only_be_specified_in_tsconfig_json_file_or_set_to_null_on_command_line + }); + }); + + describe("option of type list", () => { + verifyNull({ + optionName: "rootDirs", + nonNullValue: "abc,xyz", + diagnosticMessage: Diagnostics.Option_0_can_only_be_specified_in_tsconfig_json_file_or_set_to_null_on_command_line + }); + }); + + describe("option of type string", () => { + verifyNullNonIncludedOption({ + type: () => "string", + nonNullValue: "hello" + }); + }); + + describe("option of type number", () => { + verifyNullNonIncludedOption({ + type: () => "number", + nonNullValue: "10" + }); + }); + + describe("option of type Map", () => { + verifyNullNonIncludedOption({ + type: () => createMapFromTemplate({ + node: ModuleResolutionKind.NodeJs, + classic: ModuleResolutionKind.Classic, + }), + nonNullValue: "node" + }); + }); + }); + + it("allows tsconfig only option to be set to null", () => { + assertParseResult(["--composite", "null", "-tsBuildInfoFile", "null", "0.ts"], + { + errors: [], + fileNames: ["0.ts"], + options: { composite: undefined, tsBuildInfoFile: undefined } + }); + }); + describe("Watch options", () => { it("parse --watchFile", () => { assertParseResult(["--watchFile", "UseFsEvents", "0.ts"], @@ -487,9 +662,7 @@ namespace ts { describe("unittests:: config:: commandLineParsing:: parseBuildOptions", () => { function assertParseResult(commandLine: string[], expectedParsedBuildCommand: ParsedBuildCommand) { const parsed = parseBuildCommand(commandLine); - const parsedBuildOptions = JSON.stringify(parsed.buildOptions); - const expectedBuildOptions = JSON.stringify(expectedParsedBuildCommand.buildOptions); - assert.equal(parsedBuildOptions, expectedBuildOptions); + assert.deepEqual(parsed.buildOptions, expectedParsedBuildCommand.buildOptions); assert.deepEqual(parsed.watchOptions, expectedParsedBuildCommand.watchOptions); const parsedErrors = parsed.errors; diff --git a/src/testRunner/unittests/tsc/composite.ts b/src/testRunner/unittests/tsc/composite.ts new file mode 100644 index 00000000000..8eb0ea3bd85 --- /dev/null +++ b/src/testRunner/unittests/tsc/composite.ts @@ -0,0 +1,85 @@ +namespace ts { + describe("unittests:: tsc:: composite::", () => { + verifyTsc({ + scenario: "composite", + subScenario: "when setting composite false on command line", + fs: () => loadProjectFromFiles({ + "/src/project/src/main.ts": "export const x = 10;", + "/src/project/tsconfig.json": Utils.dedent` + { + "compilerOptions": { + "target": "es5", + "module": "commonjs", + "composite": true, + }, + "include": [ + "src/**/*.ts" + ] + }`, + }), + commandLineArgs: ["--composite", "false", "--p", "src/project"], + }); + + verifyTsc({ + scenario: "composite", + subScenario: "when setting composite null on command line", + fs: () => loadProjectFromFiles({ + "/src/project/src/main.ts": "export const x = 10;", + "/src/project/tsconfig.json": Utils.dedent` + { + "compilerOptions": { + "target": "es5", + "module": "commonjs", + "composite": true, + }, + "include": [ + "src/**/*.ts" + ] + }`, + }), + commandLineArgs: ["--composite", "null", "--p", "src/project"], + }); + + verifyTsc({ + scenario: "composite", + subScenario: "when setting composite false on command line but has tsbuild info in config", + fs: () => loadProjectFromFiles({ + "/src/project/src/main.ts": "export const x = 10;", + "/src/project/tsconfig.json": Utils.dedent` + { + "compilerOptions": { + "target": "es5", + "module": "commonjs", + "composite": true, + "tsBuildInfoFile": "tsconfig.json.tsbuildinfo" + }, + "include": [ + "src/**/*.ts" + ] + }`, + }), + commandLineArgs: ["--composite", "false", "--p", "src/project"], + }); + + verifyTsc({ + scenario: "composite", + subScenario: "when setting composite false and tsbuildinfo as null on command line but has tsbuild info in config", + fs: () => loadProjectFromFiles({ + "/src/project/src/main.ts": "export const x = 10;", + "/src/project/tsconfig.json": Utils.dedent` + { + "compilerOptions": { + "target": "es5", + "module": "commonjs", + "composite": true, + "tsBuildInfoFile": "tsconfig.json.tsbuildinfo" + }, + "include": [ + "src/**/*.ts" + ] + }`, + }), + commandLineArgs: ["--composite", "false", "--p", "src/project", "--tsBuildInfoFile", "null"], + }); + }); +} diff --git a/tests/baselines/reference/tsc/composite/initial-build/when-setting-composite-false-and-tsbuildinfo-as-null-on-command-line-but-has-tsbuild-info-in-config.js b/tests/baselines/reference/tsc/composite/initial-build/when-setting-composite-false-and-tsbuildinfo-as-null-on-command-line-but-has-tsbuild-info-in-config.js new file mode 100644 index 00000000000..8b1e90d965b --- /dev/null +++ b/tests/baselines/reference/tsc/composite/initial-build/when-setting-composite-false-and-tsbuildinfo-as-null-on-command-line-but-has-tsbuild-info-in-config.js @@ -0,0 +1,11 @@ +//// [/lib/initial-buildOutput.txt] +/lib/tsc --composite false --p src/project --tsBuildInfoFile null +exitCode:: ExitStatus.Success + + +//// [/src/project/src/main.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.x = 10; + + diff --git a/tests/baselines/reference/tsc/composite/initial-build/when-setting-composite-false-on-command-line-but-has-tsbuild-info-in-config.js b/tests/baselines/reference/tsc/composite/initial-build/when-setting-composite-false-on-command-line-but-has-tsbuild-info-in-config.js new file mode 100644 index 00000000000..dc7ed0590b7 --- /dev/null +++ b/tests/baselines/reference/tsc/composite/initial-build/when-setting-composite-false-on-command-line-but-has-tsbuild-info-in-config.js @@ -0,0 +1,12 @@ +//// [/lib/initial-buildOutput.txt] +/lib/tsc --composite false --p src/project +src/project/tsconfig.json(6,9): error TS5069: Option 'tsBuildInfoFile' cannot be specified without specifying option 'incremental' or option 'composite'. +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated + + +//// [/src/project/src/main.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.x = 10; + + diff --git a/tests/baselines/reference/tsc/composite/initial-build/when-setting-composite-false-on-command-line.js b/tests/baselines/reference/tsc/composite/initial-build/when-setting-composite-false-on-command-line.js new file mode 100644 index 00000000000..878fe45b3ff --- /dev/null +++ b/tests/baselines/reference/tsc/composite/initial-build/when-setting-composite-false-on-command-line.js @@ -0,0 +1,11 @@ +//// [/lib/initial-buildOutput.txt] +/lib/tsc --composite false --p src/project +exitCode:: ExitStatus.Success + + +//// [/src/project/src/main.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.x = 10; + + diff --git a/tests/baselines/reference/tsc/composite/initial-build/when-setting-composite-null-on-command-line.js b/tests/baselines/reference/tsc/composite/initial-build/when-setting-composite-null-on-command-line.js new file mode 100644 index 00000000000..c30cd727af7 --- /dev/null +++ b/tests/baselines/reference/tsc/composite/initial-build/when-setting-composite-null-on-command-line.js @@ -0,0 +1,11 @@ +//// [/lib/initial-buildOutput.txt] +/lib/tsc --composite null --p src/project +exitCode:: ExitStatus.Success + + +//// [/src/project/src/main.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.x = 10; + + From 91df1c8b531c38093928f9bf2016d3df1a7b055e Mon Sep 17 00:00:00 2001 From: csigs Date: Thu, 27 Feb 2020 04:10:29 +0000 Subject: [PATCH 9/9] LEGO: check in for master to temporary branch. --- .../diagnosticMessages.generated.json.lcl | 988 +++++++++++++++++- 1 file changed, 980 insertions(+), 8 deletions(-) diff --git a/src/loc/lcl/trk/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/trk/diagnosticMessages/diagnosticMessages.generated.json.lcl index 5651e368fd8..0a26fe3f277 100644 --- a/src/loc/lcl/trk/diagnosticMessages/diagnosticMessages.generated.json.lcl +++ b/src/loc/lcl/trk/diagnosticMessages/diagnosticMessages.generated.json.lcl @@ -44,12 +44,18 @@ + + + + + + @@ -92,6 +98,9 @@ + + + @@ -209,6 +218,9 @@ + + + @@ -224,6 +236,9 @@ + + + @@ -413,6 +428,9 @@ + + + @@ -428,6 +446,9 @@ + + + @@ -503,12 +524,18 @@ + + + + + + @@ -587,6 +614,9 @@ + + + @@ -641,12 +671,18 @@ + + + + + + @@ -770,8 +806,8 @@ - - + + @@ -827,6 +863,9 @@ + + + @@ -971,6 +1010,9 @@ + + + @@ -1004,18 +1046,27 @@ + + + + + + + + + @@ -1031,18 +1082,27 @@ + + + + + + + + + @@ -1067,6 +1127,9 @@ + + + @@ -1103,18 +1166,27 @@ + + + + + + + + + @@ -1142,6 +1214,9 @@ + + + @@ -1157,6 +1232,9 @@ + + + @@ -1208,12 +1286,18 @@ + + + + + + @@ -1283,6 +1367,9 @@ + + + @@ -1316,6 +1403,9 @@ + + + @@ -1340,6 +1430,9 @@ + + + @@ -1382,12 +1475,18 @@ + + + + + + @@ -1412,24 +1511,36 @@ + + + + + + + + + + + + @@ -1481,6 +1592,9 @@ + + + @@ -1496,6 +1610,9 @@ + + + @@ -1556,6 +1673,9 @@ + + + @@ -1571,6 +1691,9 @@ + + + @@ -1586,12 +1709,18 @@ + + + + + + @@ -1733,6 +1862,9 @@ + + + @@ -1793,12 +1925,18 @@ + + + + + + @@ -1850,12 +1988,18 @@ + + + + + + @@ -1901,12 +2045,18 @@ + + + + + + @@ -1958,6 +2108,9 @@ + + + @@ -1991,6 +2144,9 @@ + + + @@ -2042,6 +2198,9 @@ + + + @@ -2069,6 +2228,9 @@ + + + @@ -2084,6 +2246,9 @@ + + + @@ -2108,6 +2273,9 @@ + + + @@ -2132,12 +2300,18 @@ + + + + + + @@ -2189,6 +2363,9 @@ + + + @@ -2222,6 +2399,9 @@ + + + @@ -2285,6 +2465,9 @@ + + + @@ -2327,48 +2510,72 @@ + + + + + + + + + + + + + + + + + + + + + + + + @@ -2456,18 +2663,27 @@ + + + + + + + + + @@ -2525,6 +2741,9 @@ + + + @@ -2567,6 +2786,9 @@ + + + @@ -2699,6 +2921,9 @@ + + + @@ -2825,6 +3050,9 @@ + + + @@ -2867,6 +3095,9 @@ + + + @@ -2927,12 +3158,18 @@ + + + + + + @@ -2948,6 +3185,9 @@ + + + @@ -2999,6 +3239,9 @@ + + + @@ -3023,12 +3266,18 @@ + + + + + + @@ -3044,12 +3293,18 @@ + + + + + + @@ -3065,12 +3320,18 @@ + + + + + + @@ -3095,12 +3356,18 @@ + + + + + + @@ -3125,6 +3392,9 @@ + + + @@ -3149,12 +3419,18 @@ + + + + + + @@ -3170,18 +3446,27 @@ + + + + + + + + + @@ -3227,12 +3512,18 @@ + + + + + + @@ -3266,6 +3557,9 @@ + + + @@ -3347,12 +3641,18 @@ + + + + + + @@ -3404,42 +3704,63 @@ + + + + + + {1}'?]]> + + {1}' türüne kısıtlanmasını mı istediniz?]]> + + + + + + + + + + + + + @@ -3740,6 +4061,9 @@ + + + @@ -3782,24 +4106,36 @@ + + + + + + + + + + + + @@ -3824,6 +4160,9 @@ + + + @@ -3848,6 +4187,9 @@ + + + @@ -3890,6 +4232,9 @@ + + + @@ -3923,12 +4268,18 @@ + + + + + + @@ -4046,6 +4397,9 @@ + + + @@ -4160,6 +4514,9 @@ + + + @@ -4175,8 +4532,8 @@ - - + + @@ -4316,6 +4673,9 @@ + + + @@ -4403,24 +4763,36 @@ + + + + + + + + + + + + @@ -4481,6 +4853,9 @@ + + + @@ -4496,6 +4871,9 @@ + + + @@ -4511,6 +4889,9 @@ + + + @@ -4604,6 +4985,9 @@ + + + @@ -4745,6 +5129,9 @@ + + + @@ -4796,6 +5183,9 @@ + + + @@ -4892,6 +5282,9 @@ + + + @@ -4937,6 +5330,9 @@ + + + @@ -4961,6 +5357,9 @@ + + + @@ -5030,6 +5429,9 @@ + + + @@ -5087,6 +5489,9 @@ + + + @@ -5225,6 +5630,9 @@ + + + @@ -5504,6 +5912,9 @@ + + + @@ -5633,6 +6044,9 @@ + + + @@ -5888,6 +6302,9 @@ + + + @@ -5957,24 +6374,36 @@ + + + + + + + + + + + + @@ -6008,6 +6437,9 @@ + + + @@ -6032,6 +6464,9 @@ + + + @@ -6086,6 +6521,9 @@ + + + @@ -6128,6 +6566,9 @@ + + + @@ -6218,18 +6659,27 @@ + + + + + + + + + @@ -6245,24 +6695,36 @@ + + + + + + + + + + + + @@ -6287,6 +6749,9 @@ + + + @@ -6311,12 +6776,18 @@ + + + + + + @@ -6332,6 +6803,9 @@ + + + @@ -6455,6 +6929,9 @@ + + + @@ -6536,6 +7013,9 @@ + + + @@ -6569,6 +7049,9 @@ + + + @@ -6620,6 +7103,9 @@ + + + @@ -6653,6 +7139,9 @@ + + + @@ -6713,6 +7202,9 @@ + + + @@ -6782,6 +7274,9 @@ + + + @@ -6797,18 +7292,27 @@ + + + + + + + + + @@ -7013,12 +7517,18 @@ + + + + + + @@ -7097,6 +7607,9 @@ + + + @@ -7112,6 +7625,9 @@ + + + @@ -7154,6 +7670,9 @@ + + + @@ -7169,18 +7688,27 @@ + + + + + + + + + @@ -7196,6 +7724,9 @@ + + + @@ -7211,6 +7742,9 @@ + + + @@ -7244,12 +7778,18 @@ + + + + + + @@ -7373,12 +7913,18 @@ + + + + + + @@ -7406,12 +7952,18 @@ + + + + + + @@ -7436,6 +7988,9 @@ + + + @@ -7451,12 +8006,18 @@ + + + + + + @@ -7535,6 +8096,9 @@ + + + @@ -7595,12 +8159,18 @@ + + + + + + @@ -7760,6 +8330,9 @@ + + + @@ -7784,6 +8357,9 @@ + + + @@ -7808,6 +8384,9 @@ + + + @@ -7859,18 +8438,27 @@ + + + + + + + + + @@ -7886,6 +8474,9 @@ + + + @@ -7910,6 +8501,9 @@ + + + @@ -7925,6 +8519,9 @@ + + + @@ -8108,12 +8705,18 @@ + + + + + + @@ -8129,6 +8732,9 @@ + + + @@ -8420,12 +9026,18 @@ + + + + + + @@ -8504,6 +9116,9 @@ + + + @@ -8537,6 +9152,9 @@ + + + @@ -8552,6 +9170,9 @@ + + + @@ -8576,6 +9197,9 @@ + + + @@ -8591,18 +9215,27 @@ + + + + + + + + + @@ -8654,12 +9287,18 @@ + + + + + + @@ -8795,6 +9434,9 @@ + + + @@ -8864,6 +9506,9 @@ + + + @@ -8885,12 +9530,18 @@ + + + + + + @@ -8915,12 +9566,18 @@ + + + + + + @@ -8972,6 +9629,9 @@ + + + @@ -8996,12 +9656,18 @@ + + + + + + @@ -9017,6 +9683,9 @@ + + + @@ -9041,6 +9710,9 @@ + + + @@ -9077,12 +9749,18 @@ + + + + + + @@ -9134,6 +9812,9 @@ + + + @@ -9167,6 +9848,9 @@ + + + @@ -9182,12 +9866,18 @@ + + + + + + @@ -9242,14 +9932,17 @@ + + + - - + + @@ -9260,8 +9953,8 @@ - - + + @@ -9272,6 +9965,9 @@ + + + @@ -9287,12 +9983,18 @@ + + + + + + @@ -9353,6 +10055,9 @@ + + + @@ -9380,6 +10085,9 @@ + + + @@ -9407,6 +10115,9 @@ + + + @@ -9440,6 +10151,9 @@ + + + @@ -9464,24 +10178,36 @@ + + + + + + + + + + + + @@ -9515,24 +10241,36 @@ + + + + + + + + + + + + @@ -9557,30 +10295,45 @@ + + + + + + + + + + + + + + + @@ -9596,6 +10349,9 @@ + + + @@ -9611,18 +10367,27 @@ + + + + + + + + + @@ -9647,6 +10412,9 @@ + + + @@ -9674,12 +10442,18 @@ + + + + + + @@ -9713,12 +10487,18 @@ + + + + + + @@ -9743,12 +10523,18 @@ + + + + + + @@ -9986,6 +10772,9 @@ + + + @@ -10019,6 +10808,9 @@ + + + @@ -10043,6 +10835,9 @@ + + + @@ -10067,6 +10862,9 @@ + + + @@ -10136,6 +10934,9 @@ + + + @@ -10187,12 +10988,18 @@ + + + + + + @@ -10256,6 +11063,9 @@ + + + @@ -10370,12 +11180,18 @@ '}` or `>`?]]> + + '}` veya `>`?]]> + + + + @@ -10391,12 +11207,18 @@ + + + + + + @@ -10412,6 +11234,9 @@ + + + @@ -10436,18 +11261,27 @@ + + + + + + + + + @@ -10535,6 +11369,9 @@ + + + @@ -10550,6 +11387,9 @@ + + + @@ -10574,6 +11414,9 @@ + + + @@ -10616,12 +11459,18 @@ + + + + + + @@ -10682,6 +11531,9 @@ + + + @@ -10697,12 +11549,18 @@ + + + + + + @@ -10736,6 +11594,9 @@ + + + @@ -10751,24 +11612,36 @@ + + + + + + + + + + + + @@ -10784,6 +11657,9 @@ + + + @@ -10817,6 +11693,9 @@ + + + @@ -10841,18 +11720,27 @@ + + + + + + + + + @@ -10886,6 +11774,9 @@ + + + @@ -11009,6 +11900,9 @@ + + + @@ -11024,6 +11918,9 @@ + + + @@ -11048,6 +11945,9 @@ + + + @@ -11063,6 +11963,9 @@ + + + @@ -11087,18 +11990,27 @@ + + + + + + + + + @@ -11114,6 +12026,9 @@ + + + @@ -11129,18 +12044,27 @@ + + + + + + + + + @@ -11156,6 +12080,9 @@ + + + @@ -11174,6 +12101,9 @@ + + + @@ -11246,6 +12176,9 @@ + + + @@ -11264,6 +12197,9 @@ + + + @@ -11288,6 +12224,9 @@ + + + @@ -11375,12 +12314,18 @@ + + + + + + @@ -11450,12 +12395,18 @@ + + + + + + @@ -11471,18 +12422,27 @@ + + + + + + + + + @@ -11507,6 +12467,9 @@ + + + @@ -11579,6 +12542,9 @@ + + + @@ -11702,12 +12668,18 @@ + + + + + +